dynamic datagrid

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using a dynamic datagrid and want to add the "delete" command,but no
matter what I try I cannot get it to work. This is what I have:

ButtonColumn del = new ButtonColumn();
del.Text = "deleteTest";
del.ButtonType = ButtonColumnType.LinkButton;
del.CommandName = "Delete";
DG.Columns.Add(del);


DG.ItemDataBound += new
System.Web.UI.WebControls.DataGridItemEventHandler(this.dgAssDealers_ItemDataBound);
DG.DeleteCommand += new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.dgAssDealers_DeleteCommand);


The ItemDataBound works fine, but not the Delete. The button shows up in the
grid, but it's not "linked" , in other words, there's nothing to click. Has
anyone got any idea how to do this? I've been banging my head all weekend on
this and just cannot get it to work :(
 
I am using a dynamic datagrid and want to add the "delete" command,but no
matter what I try I cannot get it to work. This is what I have:

ButtonColumn del = new ButtonColumn();
del.Text = "deleteTest";
del.ButtonType = ButtonColumnType.LinkButton;
del.CommandName = "Delete";
DG.Columns.Add(del);

DG.ItemDataBound += new
System.Web.UI.WebControls.DataGridItemEventHandler(this.dgAssDealers_ItemDa­taBound);
DG.DeleteCommand += new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.dgAssDealers_Del­eteCommand);

The ItemDataBound works fine, but not the Delete. The button shows up in the
grid, but it's not "linked" , in other words, there's nothing to click. Has
anyone got any idea how to do this? I've been banging my head all weekendon
this and just cannot get it to work :(

it looks like you are using the generic command event handler with the
key word delete. try using the event handler for delete or changing
your commandName to deleteme or something like that.
 
Back
Top