Click here to Skip to main content
16,019,614 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted

1 solution

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>


In Gridview rowcommand event based
If e.CommandName = "test" Then
           Me.Response.Redirect("NextPage.aspx?str="Value")


On page load event of NextPage
Based on the query string code to add new row to grid.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900