Select row in grid and redirect to custom details page

Hi I want to use Sfgrid as a menu when you select the row and it returns the ID then redirect to a different detail page. Please point me in the right direction, thanks a lot.


3 Replies

JP Jeevakanth Palaniappan Syncfusion Team December 7, 2021 07:56 AM UTC

Hi Hugh, 

Greetings from Syncfusion support. 

We have validated your query and you can achieve your requirement by using the RowSelected event of the grid. In the event handler you can navigate to different page by using the NavigationManager. Please refer the below ode snippet and the sample for your reference. 

@inject NavigationManager Navigate 
 
<SfGrid DataSource="@Orders" Height="280" AllowReordering="true"> 
    <GridEvents TValue="Order" RowSelected="RowSeletedHandler"></GridEvents> 
</SfGrid> 
 
@code { 
    public void RowSeletedHandler(RowSelectEventArgs<Order> args) 
    { 
        Navigate.NavigateTo("/fetchdata"); 
    } 

Documentation: 


Get back to us if you have any other queries. 

Regards, 
Jeevakanth SP. 



SS Swetha Srikumar Syncfusion Team December 7, 2021 08:45 AM UTC

Thanks very much – I managed to get this.. Sorry I am a beginner…


JP Jeevakanth Palaniappan Syncfusion Team December 8, 2021 06:57 AM UTC

Hi Hugh, 

We are glad that the provided solution helps you. Please get back to us if you have any other queries. 

Regards, 
Jeevakanth SP. 


Loader.
Up arrow icon