开发者

Asp.Net datagrid row selected event

开发者 https://www.devze.com 2022-12-21 09:03 出处:网络
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.what about : SelectedIndexChanged

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.


what about : SelectedIndexChanged

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


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" />


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号