|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Finding DataKey in GridViewi'd like to get datakey of GridView So i write code like below
but it wasn't work well. how should i do? protected void BookGridView_RowDataBound(object sender, GridViewRowEventArgs e) { int tableId = int.Parse( BookGridView.DataKeys[e.Row.DataItemIndex].ToString() ); ..... } Hello mike,
Once you have specified DataKeyNames, you can retrieve the datakey for the selected row by simply using - BookGridView.SelectedValue Cheers, Sumeet Show quoteHide quote > i'd like to get datakey of GridView So i write code like below but it > wasn't work well. how should i do? > > protected void BookGridView_RowDataBound(object sender, > GridViewRowEventArgs e) > { > int tableId = int.Parse( > BookGridView.DataKeys[e.Row.DataItemIndex].ToString() ); > ..... > > } >
Other interesting topics
Correct syntax for an update stored procedure
About web.config file Retreive images stored in Access database Can we search keywords in a word document? Some questions about masterpages. Setting Profile properties for not logged in users Dynamic content problem MS Forms 2.0 Combo box control How to initiate a postback in a function? Problem with aspnet_wp.exe |
|||||||||||||||||||||||