Datagrid dynamic column ruin events

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,196
Latest member
ScottChare

Latest Threads

Top