void GenToolButtonItem(ExtGridSystemHandler handler, string caption) { svcCompChange.OnComponentChanging(layout, null); ExtGridToolItem item = new ExtGridToolItem(); item.CssClass = "x-btn-text-icon details"; switch (handler) { case ExtGridSystemHandler.Add: item.IconUrl = "~/Image/Ext/add.gif"; item.ButtonName = "btnAdd"; break; case ExtGridSystemHandler.Edit: item.IconUrl = "~/Image/Ext/edit.gif"; item.ButtonName = "btnEdit"; break; case ExtGridSystemHandler.Delete: item.IconUrl = "~/Image/Ext/delete.gif"; item.ButtonName = "btnDelete"; break; case ExtGridSystemHandler.OK: item.IconUrl = "~/Image/Ext/ok.gif"; item.ButtonName = "btnOK"; break; case ExtGridSystemHandler.Cancel: item.IconUrl = "~/Image/Ext/cancel.gif"; item.ButtonName = "btnCancel"; break; //case ExtGridSystemHandler.Save: // item.IconUrl = "~/Image/Ext/save.gif"; // item.ButtonName = "btnSave"; // break; //case ExtGridSystemHandler.Abort: // item.IconUrl = "~/Image/Ext/abort.gif"; // item.ButtonName = "btnAbort"; // break; } item.Text = caption; item.SysHandlerType = handler; item.ToolItemType = ExtGridToolItemType.Button; layout.ToolItems.Add(item); svcCompChange.OnComponentChanged(layout, null, null, null); }
void GenNotButtonItem(ExtGridToolItemType type) { if (type == ExtGridToolItemType.Button || type == ExtGridToolItemType.Label) { return; } svcCompChange.OnComponentChanging(layout, null); ExtGridToolItem item = new ExtGridToolItem(); item.ToolItemType = type; layout.ToolItems.Add(item); svcCompChange.OnComponentChanged(layout, null, null, null); }