我茶饭不思  !!! 最后问一次 再不解决我就去死  兄弟们

sualtring 2003-07-25 05:24:40
<asp:Label ID="lblPrice" Runat="server" text='<%# DataBinder.Eval(Container.DataItem,"CostPriceRMB") %>'/>

Label 是嵌套在 DataGrid 模板中的

以上代码 我想在后台 DataGrid 的 ItemDataBound  事件中用硬编码实现 可否指教一下

http://expert.csdn.net/Expert/topic/2048/2048264.xml?temp=1.017398E-02
...全文
40 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
hfayga 2003-07-28
  • 打赏
  • 举报
回复
findControl
buaawjh 2003-07-28
  • 打赏
  • 举报
回复
完整解决如下
1、前台代码
<asp:Label ID="lblPrice" Runat="server" />

2、后台在ItemDataBound中写代码
if e.ite,itemindex<>-1 then
Dim objLbl As Label = CType(e.Item.FindControl("lblPrice"), Label)
IF Not(objLbl Is Nothing ) then
objlbl.text=CType(DataBinder.Eval(e.Item.DataItem, "CostPriceRMB"), String)
wanhuaren 2003-07-28
  • 打赏
  • 举报
回复
不会
cl_03 2003-07-25
  • 打赏
  • 举报
回复
兄弟:活着不容易呀

就这么死了,

也太不值了。
srachel 2003-07-25
  • 打赏
  • 举报
回复
不至于吧,我比你笨多了,就没有想到过死!^_^
infofox 2003-07-25
  • 打赏
  • 举报
回复
我想不出 就明天:)
golook 2003-07-25
  • 打赏
  • 举报
回复
不至于吧,我比你笨多了,就没有想到过死!^_^
comy 2003-07-25
  • 打赏
  • 举报
回复
Label CostPriceRMB = (Label)e.Item.FindControl("CostPriceRMB");
孟子E章 2003-07-25
  • 打赏
  • 举报
回复
http://xml.sz.luohuedu.net/xml/ShowDetail.asp?id=60B8B07E-A3DF-4AE5-B5F8-71204C7C8793
孟子E章 2003-07-25
  • 打赏
  • 举报
回复
FindControl()
vanillahill 2003-07-25
  • 打赏
  • 举报
回复
i=e.Item.ItemIndex;
DataGrid.Items[i].Controls.Add(lbPrice);
loulanlouzhu 2003-07-25
  • 打赏
  • 举报
回复
不至于吧!

来一次也不容易啊!
cchinasp 2003-07-25
  • 打赏
  • 举报
回复
如此容易的間題就死,怎麼值得呢?
i=e.item.itemIndex
datagrid1.items(i).controls(0).text=...

62,133

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧