Get Grid Selected Row Number and Total Grid Rows Number

Hello !

Please tell me how can I Get Grid Selected Row Index and Total Grid Rows Number.

I want to display a counter like : selected row number / total row numbers.

Can you help me, please ?

Thank You ! 



1 Reply

RS Renjith Singh Rajendran Syncfusion Team March 14, 2022 11:25 AM UTC

Hi Tom, 
 
Greetings from Syncfusion support. 
 
We suggest you to use the GetSelectedRowIndexesAsync method to fetch the selected row indexes and use the TotalItemCount property to fetch the total items count in grid. Please refer and use as like the codes below,  
 
 
<SfGrid @ref="Grid" DataSource="@Orders" AllowPaging="true"> 
   ... 
</SfGrid> 
 
   SfGrid<Order> Grid; 
 
    public List<double> RowIndex { get; set; } 
    public int TotalCount { get; set; } 
    public async Task OnClick() 
    { 
       RowIndex = await Grid.GetSelectedRowIndexesAsync(); 
        TotalCount = Grid.TotalItemCount; 
    } 
 
 
References :  
 
Please get back to us if you need further assistance. 
 
Regards, 
Renjith R 


Loader.
Up arrow icon