开发者

Accessing current item from ListView data source

开发者 https://www.devze.com 2023-02-06 11:30 出处:网络
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 easil

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

精彩评论

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