简体   繁体   中英

Asp.Net datagrid row selected event

在asp.net App中,我正在使用datagrid。选择行时是否会触发任何事件?我没有在网格中使用任何选择按钮。

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

您还可以将链接按钮与任何命令一起使用,并订阅RowCommand事件。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM