如何在子gridview的rowcommand事件中获取父gridview的行索引 [英] how get row index of parent gridview in the rowcommand event of child gridview
本文介绍了如何在子gridview的rowcommand事件中获取父gridview的行索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个嵌套的gridview,单击子网格中的按钮时,我想从父gridview的行的单元格中获得所需的值.
i have a nested gridview , i want to get the desired values from the cell of the row of parent gridview when the button in the child grid is clicked.
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
rowindex = Convert.ToInt16(e.CommandArgument.ToString());
}
它给了我错误,输入的字符串不是正确的fromat.
it''s giving me error,input string not in correct fromat.
推荐答案
错误消息清楚地说明了问题.我确定e.CommandArgument
的值是非数字非整数
错误:输入字符串的格式不正确 [^ ]
Error message clearly says the thing. I''m sure the value ofe.CommandArgument
isnon-numericnon-integer
Error: Input string was not in a correct format[^]
这篇关于如何在子gridview的rowcommand事件中获取父gridview的行索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文