How to trigger CommandClicked event of Grid in Template Form In Blazor Grid

Hi All,

My requirement is display the model popup on basis of click event row, But i also need to take Id of that record, I was trying to inside Templete.  But it is not support,

<GridColumn Field=@nameof(Inspection.Icolumn8) AutoFit="true">
            <Template>


                @{
                    var rec = (context as Inspection);
                    if (rec.RecType.Trim() == "HEAD")
                    {
                        <p>@rec.Icolumn8</p>
                    }
                    else
                    {
                        if (String.IsNullOrEmpty(@rec.Icolumn8))
                        {
                            <GridCommandColumns>
                                <GridCommandColumn Type=CommandButtonType.Save
                                                   ButtonOption="@(new CommandButtonOptions()
                                                               { Content = "Add Notes" })">
                                </GridCommandColumn>
                            </GridCommandColumns>
                           
                        }
                        else
                        {
                            <GridCommandColumns>
                                <GridCommandColumn Type=CommandButtonType.Edit
                                                   ButtonOption="@(new CommandButtonOptions()
                                                               { Content = "Edit Notes" })">
                                </GridCommandColumn>
                            </GridCommandColumns>
                        }

                    }
                }
            </Template>

is there any other approach to do this task ?

2 Replies 1 reply marked as answer

CH chandradev December 12, 2020 04:18 PM UTC

I got the syntax

 <SfButton @onclick="@(()=> OpenDialog(@rec.PriInspectionId))">Add Note</SfButton>

Marked as answer

RN Rahul Narayanasamy Syncfusion Team December 14, 2020 04:57 AM UTC

Hi Chandradev, 
 
Thanks for the update. 
 
We are happy to hear that you have found the solution by yourself.  
 
Please get back to us if you need further assistance. 
 
Regards, 
Rahul 


Loader.
Up arrow icon