P
PK9
I have a datagrid that brings back a number of records and I want to allow
the user to click a "delete" button in each row of the datagrid to delete
records. I originally used a <asp:ButtonColumn> for this and gave it a
CommandName attribute. This worked great. However, the client wants to have
a popup when they click on the delete button.
So now I'm thinking that I have to create a javaScript function and instead
of using an <asp:ButtonColumn>, I'll have to use an <asp:TemplateColumn> with
an embedded <asp:button> inside of the item template. In this button I'm
imagining I'll be able to do an onclick javascript event handler, but I'm not
sure how to do this.
I'm unsure how to create this type of functionality. The important piece
is being able to pass the data for the entire row, from which the delete
button was clicked, to the javascript function. This was easily done with
the button colum because the _ItemCommand event handler for the datagrid took
the input: DataGridCommandEventArgs, which had the data for the entire row.
Any thoughts? Your help is greatly appreciated.
the user to click a "delete" button in each row of the datagrid to delete
records. I originally used a <asp:ButtonColumn> for this and gave it a
CommandName attribute. This worked great. However, the client wants to have
a popup when they click on the delete button.
So now I'm thinking that I have to create a javaScript function and instead
of using an <asp:ButtonColumn>, I'll have to use an <asp:TemplateColumn> with
an embedded <asp:button> inside of the item template. In this button I'm
imagining I'll be able to do an onclick javascript event handler, but I'm not
sure how to do this.
I'm unsure how to create this type of functionality. The important piece
is being able to pass the data for the entire row, from which the delete
button was clicked, to the javascript function. This was easily done with
the button colum because the _ItemCommand event handler for the datagrid took
the input: DataGridCommandEventArgs, which had the data for the entire row.
Any thoughts? Your help is greatly appreciated.