Hi Jerry,
You need to add OnEditCommand="datagrid1_Command" and OnDeleteCommand="datagrid1_Delete" to your html page where it defines the DataGrid. This is where it ties the DataGrid to the custom methods that you created.
>I'm using ASP.Net to create a Webform.
>
>In my web form I have a data grid named datagrid1. I have created a Button Column in the data grid. The Help files says that I have to create an event handler in my web page for this button column.
>
>I am unsure how to do this.
>
>When a user clicks on any row in my datagrid button column, I want to capture the row they clicked and perform a task.
>
>In my Webform I created a few methods such as:
>
>private void datagrid1_Command(object source,
> System.Web.UI.WebControls.DataGridCommandEventArgs e)
>{
> //I do stuff here.
>}
>
>private void datagrid1_Delete(object source,
> System.Web.UI.WebControls.DataGridCommandEventArgs e)
>{
> //I do stuff here.
>}
>
>However, when I click on any button column, my Webform refreshes but none of my code is run.
>
>The name I entered in the textbox for my Command Name in the button column dialog is Delete.
>
>What am I missing when trying to use button columns in a data grid?
>
>Thanks,
>
>Jerry
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi