Click here to Skip to main content
15,885,693 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
I have a strange problem.
I'm using asp.net GridView in a Usercontrol inside Updatepanel with standard CRUD operations.
When I click on Edit to Edit a row, The gridview datasource becomes null
C#
if (!IsPostBack)
   {
     FillGrid();

   }

because it doesn't go into that line to FillGrid();
This problem vanished if remove the postback check. but then when I tried to Update the Row, it doesn't go into row_updating or any other event apart from page_load.
According to my understanding It loses all its event binding with EditItemTempelate/
Please help. I'm badly stuck on this problem

What I have tried:

1-Enable/Disabled ViewState
2-Binding separate events for Update Click.
3-Binding click event in row_editing method
a bunch of other solutions
Posted
Updated 14-Aug-16 22:17pm

1 solution

try this
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
    GridView1.EditIndex = e.NewEditIndex;
    FillGrid();
}
 
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