SVN r991
SVN-Revision: r991
This commit is contained in:
@@ -486,7 +486,7 @@ namespace Lskj.Control
|
||||
#endregion
|
||||
if (SystemInfo.Instance.GroupSpecialMode) this.gridView.EndGrouping += GridView_EndGrouping;
|
||||
|
||||
this.gridView.ShowingEditor += GridView_ShowingEditor;
|
||||
//this.gridView.ShowingEditor += GridView_ShowingEditor;
|
||||
}
|
||||
|
||||
|
||||
@@ -4694,6 +4694,7 @@ namespace Lskj.Control
|
||||
gridColumn.Caption = "操作列";
|
||||
//gridColumn.OptionsColumn.ShowCaption = false;
|
||||
gridColumn.Visible = true;
|
||||
gridColumn.OptionsColumn.AllowEdit = true;
|
||||
RepositoryItemButtonEdit ItemButtonEdit = new RepositoryItemButtonEdit();
|
||||
ItemButtonEdit.Buttons.Clear();
|
||||
ItemButtonEdit.AppearanceDisabled.Options.UseTextOptions = true;
|
||||
@@ -4703,44 +4704,75 @@ namespace Lskj.Control
|
||||
ItemButtonEdit.BorderStyle = BorderStyles.NoBorder;
|
||||
ItemButtonEdit.ButtonClick += new ButtonPressedEventHandler(OnItemButtonEdit_ButtonClick);
|
||||
DataTable rightMenuTab = BaseModuleImpl.GetBaseGridRightMenus(this.Model.ModuleCode);
|
||||
DataRow[] rightMenuBtns = rightMenuTab.Select().Where(n => !string.IsNullOrEmpty(n["IcoName"] + "")).ToArray();
|
||||
int picWidth = 30;
|
||||
foreach (DataRow rightMenu in rightMenuBtns)
|
||||
int ColumnWidth = 0;
|
||||
if (rightMenuTab.Columns.Contains("IcoName"))
|
||||
{
|
||||
GridRightMenuModel menuModel = new GridRightMenuModel(rightMenu);
|
||||
if (!string.IsNullOrWhiteSpace(menuModel.MenuName))
|
||||
// 创建只显示图片的按钮
|
||||
DataRow[] rightMenuBtns = rightMenuTab.Select().Where(n => !string.IsNullOrEmpty(n["IcoName"] + "")).ToArray();
|
||||
int picWidth = 30;
|
||||
foreach (DataRow rightMenu in rightMenuBtns)
|
||||
{
|
||||
EditorButton editorButton = new EditorButton();
|
||||
editorButton.Appearance.BackColor = Color.Transparent;
|
||||
if (!string.IsNullOrEmpty(menuModel.IcoName))
|
||||
GridRightMenuModel menuModel = new GridRightMenuModel(rightMenu);
|
||||
if (!string.IsNullOrWhiteSpace(menuModel.MenuName))
|
||||
{
|
||||
Image image = null;
|
||||
try
|
||||
EditorButton editorButton = new EditorButton();
|
||||
editorButton.Appearance.BackColor = Color.Transparent;
|
||||
if (!string.IsNullOrEmpty(menuModel.IcoName))
|
||||
{
|
||||
image = Image.FromFile(Util.PubUtil.GridColumnIco + menuModel.IcoName);
|
||||
if (image.Width > 30)
|
||||
Image image = null;
|
||||
try
|
||||
{
|
||||
image = Image.FromFile(Util.PubUtil.GridColumnIco + menuModel.IcoName);
|
||||
if (image.Width > 30)
|
||||
{
|
||||
picWidth = image.Width;
|
||||
}
|
||||
editorButton.Image = image;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
picWidth = image.Width;
|
||||
}
|
||||
editorButton.Image = image;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
editorButton.ToolTip = menuModel.MenuName;
|
||||
editorButton.Kind = ButtonPredefines.Glyph;
|
||||
editorButton.Width = picWidth;
|
||||
editorButton.Tag = menuModel;
|
||||
ItemButtonEdit.Buttons.Add(editorButton);
|
||||
}
|
||||
}
|
||||
ColumnWidth = rightMenuBtns.Length * picWidth;
|
||||
}
|
||||
if (rightMenuTab.Columns.Contains("showtoolbar"))
|
||||
{
|
||||
// 创建只显示文本的按钮
|
||||
DataRow[] rightMenuBtnsText = rightMenuTab.Select().Where(n => "1".Equals(n["showtoolbar"] + "")).ToArray();
|
||||
EditorButton textOnlyButton = new EditorButton();
|
||||
foreach (DataRow rightMenu in rightMenuBtnsText)
|
||||
{
|
||||
GridRightMenuModel menuModel = new GridRightMenuModel(rightMenu);
|
||||
if (!string.IsNullOrWhiteSpace(menuModel.MenuName))
|
||||
{
|
||||
EditorButton editorButton = new EditorButton();
|
||||
editorButton.Caption = menuModel.MenuName+"";
|
||||
//editorButton.GlyphAlignment = HorzAlignment.Center;
|
||||
editorButton.ToolTip = menuModel.MenuName;
|
||||
editorButton.Kind = ButtonPredefines.Glyph;
|
||||
editorButton.Width = this.CalculateTextWidth(editorButton.Caption, editorButton.Appearance.Font);
|
||||
editorButton.Tag = menuModel;
|
||||
ItemButtonEdit.Buttons.Add(editorButton);
|
||||
|
||||
ColumnWidth += editorButton.Width;
|
||||
}
|
||||
editorButton.ToolTip = menuModel.MenuName;
|
||||
editorButton.Kind = ButtonPredefines.Glyph;
|
||||
editorButton.Width = picWidth;
|
||||
editorButton.Tag = menuModel;
|
||||
ItemButtonEdit.Buttons.Add(editorButton);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
gridColumn.ColumnEdit = ItemButtonEdit;
|
||||
this.gridView.Columns.Add(gridColumn);
|
||||
this.gridView.OptionsBehavior.EditorShowMode = EditorShowMode.MouseDown;
|
||||
gridColumn.MaxWidth = rightMenuBtns.Length * picWidth;
|
||||
gridColumn.MinWidth = rightMenuBtns.Length * picWidth;
|
||||
gridColumn.Width = rightMenuBtns.Length * picWidth;
|
||||
gridColumn.MaxWidth = ColumnWidth;
|
||||
gridColumn.MinWidth = ColumnWidth;
|
||||
gridColumn.Width = ColumnWidth;
|
||||
}
|
||||
private void OnHighBeater(object sender, ButtonPressedEventArgs e)
|
||||
{
|
||||
@@ -8719,7 +8751,7 @@ namespace Lskj.Control
|
||||
List<int> targetPrivTypeIds = new List<int>();
|
||||
foreach (string permission in model.PrivilegeOper.Split(','))
|
||||
{
|
||||
targetPrivTypeIds.Add(int.Parse(permission));
|
||||
if(!string.IsNullOrWhiteSpace(permission)) targetPrivTypeIds.Add(int.Parse(permission));
|
||||
}
|
||||
//获取权限对应的人员名称
|
||||
string userString = string.Join(",", AuthorityTable.AsEnumerable()
|
||||
@@ -9493,4 +9525,29 @@ namespace Lskj.Control
|
||||
|
||||
|
||||
}
|
||||
|
||||
_lastGroupCount = currentGroupCount;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 设置数值的编辑格式
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void GridView_ShowingEditor(object sender, CancelEventArgs e)
|
||||
{
|
||||
GridColumn gridColumn = gridView.FocusedColumn;
|
||||
if (gridColumn != null && gridColumn.Tag != null)
|
||||
{
|
||||
GridColumnModel model = (GridColumnModel)gridColumn.Tag;
|
||||
if ((model.FieldType == ControlType.LabTextInt || model.FieldType == ControlType.LabCalcText || model.FieldType == ControlType.LabAccount)&& gridColumn.RealColumnEdit!=null)
|
||||
{
|
||||
gridColumn.RealColumnEdit.EditFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
|
||||
gridColumn.RealColumnEdit.EditFormat.FormatString = model.DataFormat;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// 计
|
||||
Reference in New Issue
Block a user