如何根据另一个网格的行选择填充网格 [英] How to populate a grid based on the row selection from another grid
本文介绍了如何根据另一个网格的行选择填充网格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有2个网格,它们位于不同的Web窗体上.两者都在预填充.
现在,我想根据第二个网格的行选择在我的第一个网格中添加新行.
谁能给我发送任何示例代码来做到这一点.
Hi,
I have 2 grids, which are on different webforms. Both are prepopulating.
Now i want to add a new row in my 1st grid , based on the row selection of second grid.
Can anyone send me any sample code to do that.
推荐答案
如果您使用的是模板字段列.
If you are using template field column.
<asp:GridView>
<Columns>
<TemplateField>
<ItemTemplate>
><asp:LinkButton ID="LinkButton1" runat="server" CommandName="test">Redirect</asp:LinkButton>
</ItemTemplate>
</TemplateField>
</Columns>
</GridView>
在Gridview中,基于rowcommand事件的事件
In Gridview rowcommand event based
If e.CommandName = "test" Then
Me.Response.Redirect("NextPage.aspx?str="Value")
NextPage的页面加载事件
根据查询字符串代码向网格添加新行.
On page load event of NextPage
Based on the query string code to add new row to grid.
这篇关于如何根据另一个网格的行选择填充网格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文