views:

286

answers:

3

In asp.net App I am using datagrid.Is there any event fired when a row is selected?I am not using any select button in grid.

A: 

what about : SelectedIndexChanged

"Occurs when a different item is selected in a data listing control between posts to the server"

Asad Butt
That won't fire if there is no select button like he mentioned.
thekaido
A: 

SelectedIndexChanged event will fired when you click on Select Command.

You can use a CommandField or a templateField to implement a Select. if you are using a command field enable SelectCommand and assign somthing to Select Text. And if you are using a template filed put a LinkButton on it and Assign Select toCommand property like this

<asp:LinkButton ID="lnbSelect" runat="server" CommandName="Select" />
Nasser Hadjloo
A: 

You can also use any link button with any command and subscribe to the RowCommand event.

Dmitry Grekov