GridView cause postback and raise an event

  • Thread starter Thread starter AAaron123
  • Start date Start date
A

AAaron123

With a GridView control when user double clicks an item it becomes
highlighted.

I would like that to cause a postback with a raised event.

The best I can determine that is not possible.

Am I correct?


Thanks
 
Everything possible, depends how much money you have :)

You can always "invent" an event if one is missing.
See GridView.RowCommand Event

George.
 
With a GridView control when user double clicks an item it becomes
highlighted.

I would like that to cause a postback with a raised event.

The best I can determine that is not possible.

Am I correct?

Thanks

Hi

With gridview there is an option for a "select" command button to be
placed in an additional column. This will raise a SelectedIndexChange
event. It has limited use because it only tells you the index of the
row that is selected.

As George suggested, a better alternative is to create a template
column and put a button or linkbutton there. Use the command name
property to indicate that the button has been clicked and the
CommandArgument to indicate the data key of the row that is clicked.
To do this bind the CommandArgument to the datasource.

When the button is clicked it will raise the RowCommand event and the
EventArgument parameter e will contain the CommandName and
CommandArgument, from which you can write code to detect and respond
accordingly.
 
Thanks


George said:
Everything possible, depends how much money you have :)

You can always "invent" an event if one is missing.
See GridView.RowCommand Event

George.
 
Thanks for all the info. I'll try that.

Stan said:
Hi

With gridview there is an option for a "select" command button to be
placed in an additional column. This will raise a SelectedIndexChange
event. It has limited use because it only tells you the index of the
row that is selected.

As George suggested, a better alternative is to create a template
column and put a button or linkbutton there. Use the command name
property to indicate that the button has been clicked and the
CommandArgument to indicate the data key of the row that is clicked.
To do this bind the CommandArgument to the datasource.

When the button is clicked it will raise the RowCommand event and the
EventArgument parameter e will contain the CommandName and
CommandArgument, from which you can write code to detect and respond
accordingly.
 
Back
Top