在嵌套网格中,无法在内部网格事件中获取外部网格行索引 [英] In nested grid not able to take outer grid row index at inner grids events

查看:121
本文介绍了在嵌套网格中,无法在内部网格事件中获取外部网格行索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我采用了一个网格视图grd_Outer,在其模板字段中采用了另一个网格视图grd_Inner.

在grd_Inner_RowUpdating/RowDeleting/RowCanceling事件上,我需要grd_Uoter网格的行索引.

I have taken one grid view grd_Outer and in its template field take another grid view grd_Inner.

On grd_Inner_RowUpdating/RowDeleting/RowCanceling event I need row index of grd_Uoter grid.

Is there any way I can do this?

推荐答案

正在工作..
Its working ..
protected void inner_grid_RowEditing(object sender, GridViewEditEventArgs e)
{
            // Get selected row 
            GridViewRow row = (GridViewRow)(sender as Control).Parent.Parent;
            int index = row.RowIndex;
            // Get Inner grid view
            GridView inner_grid = new GridView();
            inner_grid = outer_grid.Rows[index].FindControl("inner_grid") as GridView;
}


也许本文将帮助您解决嵌套网格的问题.
可编辑的嵌套数据网格 [
Perhaps this Article will help you to sort out the issues you are having with nested Grid.
Editable Nested DataGrid[^]
Else be precise where are getting problem or what errors you encountered.


这篇关于在嵌套网格中,无法在内部网格事件中获取外部网格行索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆