获取所有的Gridview的DatakeyName值 [英] Get All the DatakeyName Value that of Gridview
本文介绍了获取所有的Gridview的DatakeyName值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好朋友,
我绑定了一个具有DatakeyName = OrderID的gridview.现在,我想获取所有的datakeyName值.意思是如果在gridview 50记录绑定中,那么我想要那个的所有数据键值...
谁能告诉我我该怎么做... !!!!
谢谢大家提前...
Hello Friends,
I have bind one gridview which have DatakeyName=OrderID. Now i want to get all the datakeyName value. Means if in gridview 50 record bind then i want all the datakey value of that...
Can any one tell me that how can i do that...!!!!
Thank You to All In Advance...
推荐答案
您好,
请尝试以下逻辑来实现它.
Hello,
Please try below logic to achieve it.
foreach(GridViewRow row in GridView1.Rows)
{
string index = Convert.ToString(GridView1.DataKeys[row.RowIndex].Value);
// Do something
}
请让我们知道.
Please let us know if any.
这篇关于获取所有的Gridview的DatakeyName值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文