I am bit new to Asp.net GridView, and I am facing the following problem. I have a gridview placed in an ascx. This ascx is loaded dynamically within an aspx, in its Page_Init method Control control = LoadControl("~/grid.ascx"); PlaceHolder1.Controls.Add(control);
The grid is bound to a IList (which is populated from the data access layer). I have a button field in the grid, which is used to call the delete function in DA layer for the row (performs this call in GridView1_RowCommand()).
My question is, I dont see the grid view getting refreshed after I perform the delete. I placed the code to re-read and bind data to gridview in many places, but none seems to work.
Notes: 1. The loading of ascx is done in an ajax call for the aspx 2. Delete function actually modifies the 'Status' column of 'User' to 'Deleted' which I need to see in the gridview after I do so
Can you please help me?
Edit: It seems that RowDataBound event is fired (for each row of course) after page load, and then only the button command event fire. Though I set the modified DS and DataBind on the gridview, it never fires the RowDataBound afterwards. Any idea why? Thanks in advance.
Anuruddha