在父网格中搜索子网格 [英] Search for a child grid within a parent grid
本文介绍了在父网格中搜索子网格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的朋友,
我对asp.net datagridview有问题.
我在父网格中有一个子网格.我在窗体的外部有一个按钮,单击该按钮时必须添加一个空白的数据行,但是由于我无法在父网格中找到子网格,因此无法添加空白行. >
请帮助我找到子网格.
谢谢
Varun Sareen
Dear Friends,
I have a problem regarding the asp.net datagridview.
I have a child grid within a parent grid. I have a button outside means on the form on the click o f which i have to add a blank datarow but as i am not able to find the child grid within the parent grid, I am not able to add the blank row.
Please help me find the child grid.
Thanks
Varun Sareen
推荐答案
gdvparentgrid.findcontrol("chilgridId");
gdvparentgrid.findcontrol("chilgridId");
看看此链接 ^ ]在这里,它正在使用GridViewRow对象遍历GridView控件的所有行,然后使用FindControl方法来获取该控件.可以将代码替换为您的子gridview.
Have a look at this link Accessing the different controls inside a GridView control[^]Here it is iterating through all the rows of the GridView control using the GridViewRow object and then using FindControl method to get the control.You can replace the code with your child gridview.
这篇关于在父网格中搜索子网格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文