让templetfield充满活力 [英] Get templetfield as dynamic

查看:127
本文介绍了让templetfield充满活力的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好先生,

我正在使用templatefield和Boundfield进行gridview。在加载所有数据之前,我正在以正确的方式获取限制但不从模板字段获取数据如何执行此操作.....

Hello sir,
I am making gridview with using templatefield and Boundfield. Before loading all data I am getting boundfield proper way but not get data from templatefield how to do this.....

Dim columnmove As DataControlField
columnmove = dgPackets.Columns(1)



这个为boundfield提供所有正确的数据但是templatefield无法正常工作。





由Haris添加的代码块

推荐答案

您好,



从OnRowDataBound事件中检索的示例...



Hi,

Example retrieving from OnRowDataBound event...

Dim data As DataRowView = DirectCast(e.Row.DataItem, DataRowView)
Dim imgStatus As Image = DirectCast(e.Row.FindControl("gvStatusItem"), Image)
If e.Row.RowType = DataControlRowType.DataRow Then
   ' Your code here
   Dim columnmove As String
   columnmove = dgPackets.Columns("Your column field name")

   
End If



不要忘记投票,如果有帮助,最高投票是5.



问候,


Do not forget to vote if could help, the highest vote is 5.

Regards,


这篇关于让templetfield充满活力的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆