[Sv] - How to get index each item in selecteditems?

Hi,
I'm stuck to get this result. Please show me how to do it without going through the event.
thanks you!


3 Replies 1 reply marked as answer

FP Farjana Parveen Ayubb Syncfusion Team June 22, 2020 07:24 AM UTC

Hi GridLock, 
 
Thank you for using Syncfusion controls. 
 
You can get the RowIndex of SelectedItems by using ResolveToRowIndex method. Please refer the below code example 
 
foreach (var selectedItem in sfDataGrid.SelectedItems) 
{ 
    var index = sfDataGrid.TableControl.ResolveToRowIndex(selectedItem); 
} 
 
 
Regards, 
Farjana Parveen A 


Marked as answer

TG The GridLock June 23, 2020 02:32 AM UTC

Hi Farjana,
Thanks for the code. It helped me.


SS Susmitha Sundar Syncfusion Team June 23, 2020 06:03 AM UTC

Hi khanh dang, 
 
Thanks for the update. 
 
We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this.  
 
Regards, 
Susmitha S 


Loader.
Up arrow icon