Skip to content

DevExpress-Examples/blazor-grid-command-buttons-with-custom-icons

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blazor Grid - Use Custom Icons as Command Buttons

A command column displays the following predefined buttons (icons):

  • New (column header)
  • Edit, Delete (data rows in display mode)
  • Save, Cancel (data rows in EditRow and EditCell modes)

You can use HeaderTemplate, CellDisplayTemplate, or CellEditTemplate to change command button appearance within the DevExpress Blazor Grid.

Grid with Custom Icons

Handle button/icon click events and call StartEditNewRowAsync, StartEditDataItemAsync and ShowDataItemDeleteConfirmation methods to implement required functionality. Pass the following parameters:

  • A null object if you want to create a new record
  • An existing object if you edit or delete a record

Use the context object to obtain the current row object in the column CellDisplayTemplate:

<CellDisplayTemplate>
    <a class="oi oi-pencil link-decoration" @onclick="@(() => MyGrid.StartEditRowAsync(context.VisibleIndex))" href="javascript:void(0);"></a>
    <a class="oi oi-x link-decoration" @onclick="@(() => MyGrid.ShowDataItemDeleteConfirmation(context.DataItem))" href="javascript:void(0);"></a>
</CellDisplayTemplate>

Files to Review

Documentation

More Examples

Does This Example Address Your Development Requirements/Objectives?

(you will be redirected to DevExpress.com to submit your response)

About

Replace built-in command buttons (icons) with custom icons.

Topics

Resources

License

Stars

Watchers

Forks

Contributors