ASP.net Get Row and column index when a value is selected in a GridView

Murray Brown
Murray Brown used Ask the Experts™
on
Hi

In ASP.net I have a GridView control that I used to load data from multiple data sources.
When the user selects something in the GridView I want to get the selected row index as well as the column index.
How do I do this in a raw GridView that has no template columns?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Chief Technology Ninja
Distinguished Expert 2018
Commented:
Hi Murray,

Selected Row Index can be easily found by adding a checkbox in front of the row.
https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.gridview.selectedrow?view=netframework-4.8


BUT columns? that too without adding a checkbox (i.e. template column)? First of all, how will user even select a column? without a checkbox(even if it is a client side one and not a template one)? Could you please clarify the idea a bit.

Regards,
Chinmay.
Murray BrownASP.net/VSTO Developer

Author

Commented:
thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial