Hi,
I have read a lot of the suggested answers provided in this forum - including the one with sample zip file. However, does anyone know how to solve this issue. I have a button in the ItemTemplate which fires WebDataGrid1_ItemCommand event correctly. It does not work when the webdatagrid is inside the if statement. Is there a way around this issue without binding the grid each time the button is clicked. Please help!! Thanks!
//if (!IsPostBack) {
WebDataGrid1.DataSource = populateGrid();
WebDataGrid1.DataBind(); }
protected void WebDataGrid1_ItemCommand(object sender, HandleCommandEventArgs e) {
......
}
I solved my issue. EnableAjax = true and EnableDataViewState = true. :-)