Find a row in the grid

Hi. How to find a row in the grid by data item?

5 Replies 1 reply marked as answer

RS Renjith Singh Rajendran Syncfusion Team November 12, 2020 08:50 AM UTC

Hi Constantine, 

Greetings from Syncfusion support. 

We suspect that you would like to fetch the row index based on a row cell value. If so, then we suggest you to use the GetRowIndexByPrimaryKey method of Grid. With this you can fetch the row index based on unique valued primary key column value. 

 
<GridColumn Field=@nameof(Order.OrderID) HeaderText="Order ID" IsPrimaryKey="true" TextAlign="TextAlign.Center" Width="120"></GridColumn>
 
public async Task GetRowIndex() 
{ 
    var RowIndex = await Grid.GetRowIndexByPrimaryKey(1004); 
} 


 
If we have misunderstood your query, kindly share with us a detailed explanation of your complete requirement. 

Regards, 
Renjith Singh Rajendran 


Marked as answer

CO Constantine November 12, 2020 11:02 AM UTC

Thanks This is what was needed.


RN Rahul Narayanasamy Syncfusion Team November 13, 2020 03:29 AM UTC

Hi Constantine, 

Thanks for the update. 

Please get back to us if you need further assistance. 

Regards, 
Rahul 



AN Andy June 12, 2023 06:56 PM UTC

Hi, I've used the same suggestion but if the record is not in the first page, that method doesn't work



NP Naveen Palanivel Syncfusion Team June 14, 2023 03:20 AM UTC

Hi Andy,


We checked your query and we would like to inform you that the row index can be retrieved on a page-by-page basis. So, you can only find the index within the current view of records. If you want to find the index based on the value present on the next page, you will need to navigate to the next page and then fetch the index based on the value


Please let us know if you have any concerns.


Regards,

Naveen Palanivel


Loader.
Up arrow icon