add a toolbar button with an icon

Hi Guys,

In the grid, I need to add a button in the toolbar with an check mark icon, the code I can find like below doesn't allow me to do that.
     
                    <EjsGrid Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Cancel", "Update", "MyButton"})">
                    </EjsGrid>

Do you have a solution? Thanks!


3 Replies

VN Vignesh Natarajan Syncfusion Team February 19, 2020 06:51 AM UTC

Hi Haizhi, 

Thanks for contacting Syncfusion forums. 

Query: “In the grid, I need to add a button in the toolbar with an check mark icon, the code I can find like below doesn't allow me to do that. 

We have achieved your requirement by using custom toolbar item support in Grid. Refer the below code example.  

<EjsGrid DataSource="@Orders" @ref="Grid" AllowPaging="true" Height="200" Toolbar="Toolbaritems"> 
. . . . . . 
</EjsGrid> 
 
<style> 
    .e-check::before { 
        content'\e7ff'; 
    }    
</style> 
 
@code{ 
    EjsGrid<Order> Grid; 
    public List<Order> Orders { getset; } 
    private List<Object> Toolbaritems = new List<Object>() { "Add""Edit""Delete""Update""Cancel"new ItemModel() { Text = "Checked", TooltipText = "Checked", PrefixIcon = "e-check", Id = "Check" } }; 
. . . . . ..   
} 


Refer the below screenshot for the output  

 

We have already documented this request in our UG documentation. Kindly refer the below link for your reference 


Kindly get back to us if you have further queries. 

Regards, 
Vignesh Natarajan. 



HZ haizhi zhong February 19, 2020 04:05 PM UTC

Great.

Thank you so much!


VN Vignesh Natarajan Syncfusion Team February 20, 2020 03:35 AM UTC

Hi Haizhi,  

Thanks for the update.  

We are glad to hear that you have resolved your query using our solution.  

Kindly get back to us if you need any further assistance from us. 

Regards, 
Vignesh Natarajan.  


Loader.
Up arrow icon