Grid GridEvents RowSelected

I am using SfGrid <GridEvents RowSelected="GetSelectedRecords">

I need to get selected row value in a column named [CustomerID] and pass it trough my code

How can i access this value

3 Replies 1 reply marked as answer

JP Jeevakanth Palaniappan Syncfusion Team September 18, 2020 06:59 AM UTC

Hi Gudmundur, 

Greetings from Syncfusion support. 

We have validated your query and found that you need to get the value of CustomerID for the selected row. You can get the selected row information and its data in the argument of RowSelected event. Please refer the below code snippet for your reference. 

<SfGrid DataSource="@Orders"> 
    <GridEvents RowSelected="RowSelectHandler" TValue="Order"></GridEvents> 
    <GridColumns> 
        <GridColumn Field=@nameof(Order.CustomerID) HeaderText="Customer Name" Width="150"></GridColumn> 
</SfGrid> 
 
@code{ 
public void RowSelectHandler(RowSelectEventArgs<Order> args) 
{ 
    var CustomerIDValue = args.Data.CustomerID; 
} 
} 



Please get back to us if you need further assistance. 

Regards, 
Jeevakanth SP. 


Marked as answer

RO Robin Ostrowski May 20, 2024 06:49 PM UTC

I used RowSelected to grab the selected record's Id and navigate to a new page with it. The navigation works. However, the entire row's data flickers on click right before the page navigates. It seems to flicker and shift to the left. This doesn't happen every time, just occasionally. I'm guessing this is an automatic re-render thing? Is there a way to prevent the row's data from re-rendering?



PS Prathap Senthil Syncfusion Team May 22, 2024 02:50 AM UTC

Hi Robin,

Before proceeding with the reporting of the problem, we require some additional clarification from your end. Please share the following details to proceed further on our end:

  • To analyze the reported issue, could you please share a simple and reproducible sample with duplicate data that demonstrates the problem? This will assist us in identifying the issue more efficiently and providing a resolution.

  • Could you please share us the video demonstration of the issue with replication steps?

  • Share with us a grid code snippet with the model class?

The details requested above will be very helpful in validating the reported query on our end and providing a solution as soon as possible. Thanks for your understanding.

Regards,

Prathap S


Loader.
Up arrow icon