Hi Andrey,
Thanks for contacting Syncfusion support.
Query: “This "Add" item is displayed in toolbar, but it is always in disabled state”
We are able to reproduce the similar behavior at our end too when preparing a sample using your code example. You have created custom toolbar item named “Add” which is similar to our inbuilt Toolbar item (used to perform insert operation in Grid). This (inbuilt Add) toolbar item will be enabled only when AllowAdding property of GridEditSettings is enabled, otherwise it will be in disabled.
Since you have created the custom toolbar with similar name as inbuilt toolbar, it has been considered as inbuilt one and it is in disabled state. To overcome the reported behavior, we suggest you to define the Id property for toolbar items as below
@{
List<ItemModel> Toolbaritems = new List<Syncfusion.EJ2.Blazor.Navigations.ItemModel>();
Toolbaritems.Add(new Syncfusion.EJ2.Blazor.Navigations.ItemModel() { Text = "Add", Id="add" , TooltipText = "Add new claim", PrefixIcon = "e-ad" });
} |
Note: if you want to perform default actions for this add button, you can enable AllowAdding property of GridEditSettings.
<EjsGrid DataSource="@Orders" @ref="Grid" AllowGrouping="true" AllowPaging="true" Height="200" Toolbar="Toolbaritems">
<GridEvents OnToolbarClick="ToolbarClickHandler" TValue="Order"></GridEvents>
<GridEditSettings AllowAdding="true"></GridEditSettings>
. . . .
</EjsGrid> |
Please get back to us if you have further queries.
Regards,
Vignesh Natarajan.