M
me
If i add an edit column dynamicly:
EditCommandColumn edcol = new EditCommandColumn();
edcol.ButtonType = ButtonColumnType.LinkButton;
linksDataGrid.Columns.AddAt(0,edcol);
then when i press the edit button, the eventhandler
for the delete button is called instead (located in the
column right after the dynamic edit column). If I move the
above code from Page_load to OnInit() then the edit
events works correctly, but i fear visual studio
eventually will mess up anything i put in OnInit().
And how come it makes a difference if its in page_load
or in OnInit?
EditCommandColumn edcol = new EditCommandColumn();
edcol.ButtonType = ButtonColumnType.LinkButton;
linksDataGrid.Columns.AddAt(0,edcol);
then when i press the edit button, the eventhandler
for the delete button is called instead (located in the
column right after the dynamic edit column). If I move the
above code from Page_load to OnInit() then the edit
events works correctly, but i fear visual studio
eventually will mess up anything i put in OnInit().
And how come it makes a difference if its in page_load
or in OnInit?