I have a datalist that contains a gridview inside its itemtemplate. on the item-data_bound of the datalist i assign a certain datasource to the datagrid of that item then i add an eventhanlder for the row_data_bound of the grid.then i bind the grid.
Attach it to the grid:
gv.RowDataBound += new GridViewRowEventHandler(gv_RowDataBound);
and declare and implement the eventhandler.
The problem is the row_data_bound of the grid is not firing.
Can anyone help?
I have a datalist that contains a gridview inside its itemtemplate. on the item-data_bound
Share
Have you tried calling DataBind on the datalist quite early in the page lifecycle? The reason I ask is that the DataBinding event usually occurs just after the page’s PreRender event. When you are posting back, there is a possibility that the dynamically created EventHandler is being created too late.
Without having code to look at it is difficult to experiment to determine whether this will help, but it is worth a try.