Click here to Skip to main content
16,020,186 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
As like asp.net gridview i want to select datakey of selected row of grid in MVC4 which is not displayed in grid
Posted
Comments
Raje_ 24-Dec-15 2:26am    
which type of grid are you using? Is it kendo grid or web grid?
Vaibhav hadadare 29-Dec-15 4:21am    
Web grid

if you are using datatables then its very easy, you can access the ID columns on row-binding or row-creation events.

if you are using normal grid then you can use ID columns value as a data-userID with your controls and on clicking on some button you can access this value as object.data('userID') in jquery
 
Share this answer
 
Comments
Vaibhav hadadare 4-Jan-16 23:25pm    
Sir, may this work with hidden coloum (datakey not show in datatable).
Check this link for you answer :

does MVC WebGrid have datakey option? | The ASP.NET Forums[^]

Sadly Webgrid does not support Datakey option. It has to be eithter key to the url or hidden field.

Good luck.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900