制定工具栏——DataGrid系列

效果图:

 贴代码:

 1 @(Html.DevExtreme().DataGrid<Model>()
 2   .ID("gridMetting")
 3   .Editing(e => e
 4     .AllowAdding(true)
 5     .Texts(t => {
 6       t.AddRow("报备会议");
 7     })
 8   )
 9   .OnToolbarPreparing("toolbar_preparing")
10 )
11 
12 <script>
13 function toolbar_preparing(e) {
14   e.toolbarOptions.items.unshift(
15   {
16     location: "after", //before center
17     template: "<span>总数:10</span>"
18   },
19   {
20     location: "after",
21     widget: "dxButton",
22     options: {
23       text: "搜索",
24       icon: "find",
25       type:"ButtonType.Default",
26       onClick: function () {
27         //点击事件
28       }
29     }
30   });
31 }
32 </script>
原文地址:https://www.cnblogs.com/xiaonanmu/p/15234578.html