Customizing Dialog Template Header for Add and for BeginEdit

Hello,
I would like to inquire how I can customize the dialog headers of my Dialog Template in Blazor.
I created an onBegin (ActionBeginHandler) method as below where I do my checks on whether the template is Add or Begin Edit. But I have failed to find the way of customizing the header.
The default header title shows "Details of my Primary Key"; but the user does not need to see this Primary Key.

Any Help will be appreciated.

public async void ActionBeginHandler(ActionEventArgs<ARegion> Args) {

 if (Args.RequestType == Syncfusion.Blazor.Grids.Action.Add)
        {
            //Args.dialog.header = Args.requestType === 'beginEdit' ? 'Edit ' + Args.rowData['CountryName'] : 'Country';

          
        }

         if (Args.RequestType == Syncfusion.Blazor.Grids.Action.BeginEdit)
        {
            {
               
            }
        }
}

5 Replies 1 reply marked as answer

JP Jeevakanth Palaniappan Syncfusion Team December 28, 2020 12:45 PM UTC

Hi Sekamatte, 

Greetings from Syncfusion support.  

We have validated your query and you can customize the dialog header by using the HeaderTemplate of GridEditSettings. Please refer the below link for your reference. 


Regards, 
Jeevakanth SP. 


Marked as answer

SJ Ssekamatte James December 28, 2020 01:01 PM UTC

Thank You.
This has worked for me


JP Jeevakanth Palaniappan Syncfusion Team December 29, 2020 05:26 AM UTC

Hi Sekamatte, 

Thanks for the update. Please get back to us if you have any other queries. 

Regards, 
Jeevakanth SP. 



AB Alexander Brouwer June 20, 2022 09:25 AM UTC

For those that struggle to find the actual useful information in that link, here is snippet of code that may help:


    <GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="false" Mode="Syncfusion.Blazor.Grids.EditMode.Dialog" >

                    <HeaderTemplate>

                        @{

                                ManageUsersView.User theUser = context as ManageUsersView.User;

                                <span>@theUser.Email</span>

                      }

                    </HeaderTemplate>

                </GridEditSettings>

OR:

<GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="false" Mode="Syncfusion.Blazor.Grids.EditMode.Dialog" >

                    <HeaderTemplate>

                        Hello world

                    </HeaderTemplate>

                </GridEditSettings>



MS Monisha Saravanan Syncfusion Team June 21, 2022 09:01 AM UTC

Hi Alexandar,


Thanks for the example code snippet. Kindly get back to us if you have further queries.


Regards,

Monisha


Loader.
Up arrow icon