Thanks, that makes sense now.
Jerry
>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
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only