开发者

Accessing current item from ListView data source

I figured this wouldn't be too difficult to do, but I can't seem to figure out how to do it. Is there a way to easily access the current item from a ListView data source? For instance, you can easily evaluate the current item's properties using Eval("propertyName"), but is there a way to access the开发者_JAVA技巧 object itself?

And if this isn't possible, what I ultimately want to do is get the Type of the object.


Use FindControl Method.

For example,

int index=0; // obtain the index of an item. 
TextBox num = (TextBox)ListView1.Items[index].FindControl("numTextBox");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜