Ask a Question

Get selected row index on a Telerik RadGridView

tim_faron
Contributor

Get selected row index on a Telerik RadGridView

I have a RadGridView (Telerik.Windows.Controls.RadGridView) and i'm looking for a way in which I get the index of the selected row(s).

 

 

 

3 REPLIES 3
HKosova
Moderator

Re: Get selected row index on a Telerik RadGridView

Hi Tim,

 

Try using:

 

gridView.SelectedRows(ind).Index

where ind ranges from 0 to gridView.SelectedRows.Count.


Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
tim_faron
Contributor

Re: Get selected row index on a Telerik RadGridView

I tried the following but it didn't work, since there seems to be no SelectedRows property.

 

 

//gridView.SelectedRows(ind).Index
//where ind ranges from 0 to gridView.SelectedRows.Count.

 

I also tried this code below, but SelectedItems does not have an index Property

gridView.SelectedItems(ind).Index
where ind ranges from 0 to gridView.SelectedItems.Count.

 

 

 

HKosova
Moderator

Re: Get selected row index on a Telerik RadGridView

Hi Tim,

 

The previous answer was for Telerik WinForms grid. If you use the WPF grid, try one of these:

 

Single selection:

SelectedRow.zparentIndex

 

Multiple selection:
SelectedCells.Regions.Item(index), then list all values from .Top to .Bottom. For example, if .Top = 3 and .Bottom = 5, then selected rows = 3, 4, 5.


Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
cancel
Showing results for 
Search instead for 
Did you mean: