SfGrid Hyperlink to another Blazor component and pass parameter

Hi.

I am seeking pointers on how to do the following:

  • When a user clicks on a cell in a column in the SfGrid (as showing below) I want to navigate to another Blazor component.
  • I also want to pass the content of the cell that was clicked on (in this case computer name) to the component as a parameter.
  • The target component will be the same for all cells and load information depending on the passed parameter.


Many thanks in advance!


5 Replies

RN Rahul Narayanasamy Syncfusion Team February 28, 2022 10:59 AM UTC

Hi Ross, 

Greetings from Syncfusion. 

You want to navigate to other page with the clicked records details while clicking the cell. Here, we have already documented this topic. Find the below documentation for your reference. 


Please let us know if you have any concerns. 

Regards, 
Rahul 



RT Ross Tromans February 28, 2022 07:52 PM UTC

Ah, can't believe I didn't see this.

Many thanks Rahul, this was just what I needed.


Thanks!

Ross



VN Vignesh Natarajan Syncfusion Team March 1, 2022 04:23 AM UTC

Hi Ross,  

Thanks for the update.  

We are glad to hear that you have achieved your requirement.  

Kindly get back to us if you have further queries.  

Regards, 
Vignesh Natarajan 



ZM Zabron Muyambo November 16, 2022 04:56 AM UTC

Hi there, I am tryong to use the examples given but its not working in my case. 


<GridColumn HeaderText="ID" TextAlign="TextAlign.Left" AutoFit="true">

                    <Template>

                        @{

                            <div>

                                <a rel='nofollow' href="#" class="major tools-font" style="text-underline: none;" @onclick="@(() => OpenModalEditAssessment(@RstAssessments.AssessmentId))"><i class="fas fa-pencil-alt" />@(RstAssessments.AssessmentId)  </a>

                            </div>

                        }

                    </Template>

                </GridColumn>


code{

 ////open modal for editing

        public async Task OpenModalEditAssessment(int _assessmentId)

        {

            _parAssessmentId=_assessmentId;          

            await _jsRuntime.InvokeVoidAsync("global.openModal", "CpeModal");

        }

}




SP Sarveswaran Palani Syncfusion Team November 23, 2022 05:14 AM UTC

Hi Zabron,

Greetings from Syncfusion support.

From your query, we prepared sample based on your requirement in our latest NuGet version. But we’re unable to reproduce the reported issue at our end. Kindly share the following details to validate further.


  1. Mention the Nuget version of your current project
  2. Share us entire Grid code snippet along with model class
  3. Share us the video demonstration of the issue
  4. In your sample, you’re using JS for routing, kindly share the code snippet of your JS file
  5. If possible share us an simple issue reproduceable sample or reproduce the reported issue in the provided sample


The above-requested details will be very helpful for us to validate the reported query at our end and provide the solution as early as possible.


Regards,

Sarveswaran PK


Attachment: Column_Template_Routing_91cef652.zip

Loader.
Up arrow icon