Hi Mathew,
Thanks for using Syncfusion products.
According to your query you need to perform some action when toolbar items are clicked. We suggest you to achieve your requirement using ToolbarClick event of the Grid.
Refer the below code snippet
|
@(Html.EJ().Grid<object>("FlatGrid")
.Datasource(ds => ds.URL("/Home/UrlDataSource").Adaptor(AdaptorType.UrlAdaptor))
.ClientSideEvents(evt => evt.ToolbarClick("OnToolbarClick"))
…...
.Columns(col =>
{
col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).TextAlign(TextAlign.Right).Width(75).Add();
…...
}))
<script type="text/javascript">
function OnToolbarClick(args) {
if (sender.itemName == "Add") // itemName will Add when add button is clicked
{
// perform your action here
}
}
</script>
|
Refer our API documentation for your reference
Regards,
Vignesh Natarajan