SVN r1211
SVN-Revision: r1211
This commit is contained in:
@@ -509,7 +509,7 @@ namespace Lskj.Control
|
||||
MainGvTool.AutoPopDelay = 1000000;//提示框显示时间 10分钟
|
||||
MainGvTool.BeforeShow += new ToolTipControllerBeforeShowEventHandler(MainGvTool_BeforeShow);
|
||||
this.gridControl.ToolTipController = MainGvTool;
|
||||
this.gridView.PopupMenuShowing += new PopupMenuShowingEventHandler(OnGridView_PopupMenuShowing);//添加Footer菜单选项
|
||||
//this.gridView.PopupMenuShowing += new PopupMenuShowingEventHandler(OnGridView_PopupMenuShowing);//添加Footer菜单选项
|
||||
this.gridView.Click += new EventHandler(OnGridView_Click);//点击复制Footer数据信息
|
||||
if (SystemInfo.Instance.SelectColorHighlight)
|
||||
{
|
||||
@@ -2610,6 +2610,7 @@ namespace Lskj.Control
|
||||
if (this.ColumnList == null || this.ColumnList.Count == 0)
|
||||
{
|
||||
bool isShowFooter = false;
|
||||
List<GridColumn> autoFixColumns = new List<GridColumn>();
|
||||
for (int i = 0; i < gridView.Columns.Count; i++)
|
||||
{
|
||||
try
|
||||
@@ -2676,6 +2677,14 @@ namespace Lskj.Control
|
||||
col.DisplayFormat.FormatString = dataFormat;
|
||||
}
|
||||
}
|
||||
if (colSplit.Length > 4)
|
||||
{
|
||||
// 是否冻结列:1冻结
|
||||
if ("1".Equals(colSplit[4]))
|
||||
{
|
||||
autoFixColumns.Add(col);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2690,6 +2699,10 @@ namespace Lskj.Control
|
||||
|
||||
}
|
||||
}
|
||||
foreach (GridColumn col in autoFixColumns.Where(x => x.Visible && x.Width > 0))
|
||||
{
|
||||
col.Fixed = FixedStyle.Left;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5157,8 +5170,7 @@ namespace Lskj.Control
|
||||
btnEdit.SeparatorChar = ',';
|
||||
btnEdit.ValueMember = model.FieldType == ControlType.LabSelectReturnIdNew ? model.ValueMember : model.TextMember;
|
||||
|
||||
//model.ModuleFrameDisplayText 2026-5-23 丁哥说不需要这个字段
|
||||
if (model.FieldType == ControlType.LabSelectReturnIdNew)
|
||||
if (model.ModuleFrameDisplayText && model.FieldType == ControlType.LabSelectReturnIdNew)
|
||||
{
|
||||
DataTable dataTable = MainImpl.GetDataTableResult(modelLookUp.SysModel.MenuSql);
|
||||
btnEdit.DataSource = dataTable;
|
||||
@@ -5467,7 +5479,6 @@ namespace Lskj.Control
|
||||
this.gridView.RowStyle -= new RowStyleEventHandler(OnGridViewRowStyle);
|
||||
this.gridView.RowStyle += new RowStyleEventHandler(OnGridViewRowStyle);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5514,15 +5525,24 @@ namespace Lskj.Control
|
||||
int rowCount = this.gridView.RowCount;
|
||||
if (rowCount == 0) return;
|
||||
|
||||
// 计算数字部分宽度
|
||||
int numberWidth = (int)(rowCount.ToString().Length * 7.5) + 16;
|
||||
// 获取网格实际使用的行字体
|
||||
Font rowFont = this.gridView.Appearance.Row.Font
|
||||
?? this.gridView.GridControl?.Font
|
||||
?? SystemFonts.DefaultFont;
|
||||
|
||||
// 设置最终宽度(取较大值,并在40-80px之间)
|
||||
this.gridView.IndicatorWidth = Math.Max(40, Math.Min(80, numberWidth));
|
||||
// 用最大行号实测文本宽度(而非估算)
|
||||
string maxNumber = rowCount.ToString();
|
||||
int textWidth = TextRenderer.MeasureText(maxNumber, rowFont).Width;
|
||||
|
||||
// 附加宽度:行指示器图标(~12px) + 左右间距(~10px) + 边框
|
||||
int indicatorWidth = textWidth + 14;
|
||||
|
||||
// 限制范围 40-80px
|
||||
this.gridView.IndicatorWidth = Math.Max(40, Math.Min(80, indicatorWidth));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
// 这里可以加日志
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6470,6 +6490,8 @@ namespace Lskj.Control
|
||||
string cond = ReplaceHelper.ReplaceRowParam(gridRow, item["condition"] + "").ReplaceColumnParam(e.Column.Name, e.Column.Caption, e.CellValue + "");
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(cond) && ReplaceHelper.EvalCond(cond))
|
||||
{
|
||||
GridRowColorModel model = new GridRowColorModel(item);
|
||||
@@ -7054,6 +7076,14 @@ namespace Lskj.Control
|
||||
{
|
||||
try
|
||||
{
|
||||
//没有设置右键时,ContextMenuStrip为空。右键菜单可能会必须选中才能关闭,设置空ContextMenuStrip可用解决
|
||||
if (this.gridControl.ContextMenuStrip == null)
|
||||
{
|
||||
ContextMenuStrip MenuStrip = new ContextMenuStrip();
|
||||
this.gridControl.ContextMenuStrip = MenuStrip;
|
||||
}
|
||||
|
||||
|
||||
if (e.MenuType == GridMenuType.Column)
|
||||
{
|
||||
GridViewColumnMenu columnMenu = e.Menu as GridViewColumnMenu;
|
||||
@@ -7087,6 +7117,24 @@ namespace Lskj.Control
|
||||
if (ExportPermission) columnMenu.Items.Add(itemExportColumn);
|
||||
columnMenu.Items.AddRange(new DXMenuItem[] { itemPrintColumn, itemMultifunction, itemSortColumn, itemColumnSift, itemChartColumn, itemBsChartColumn, itemBsChartShowClick });
|
||||
}
|
||||
else if (e.MenuType == GridMenuType.Summary)
|
||||
{
|
||||
GridHitInfo info;
|
||||
Point pt = this.gridView.GridControl.PointToClient(System.Windows.Forms.Control.MousePosition);
|
||||
info = this.gridView.CalcHitInfo(pt);
|
||||
if (e.Menu is DevExpress.XtraGrid.Menu.GridViewFooterMenu)//如果是Footer菜单则增加复制行选项
|
||||
{
|
||||
DXMenuCheckItem menuItemCell = new DXMenuCheckItem();
|
||||
menuItemCell.Tag = info;
|
||||
menuItemCell.Caption = "复制合计";
|
||||
menuItemCell.Click += new EventHandler(OnMenuItem_Click);
|
||||
DXMenuCheckItem menuItemRow = new DXMenuCheckItem();
|
||||
menuItemRow.Caption = "复制合计行";
|
||||
menuItemRow.Tag = info;
|
||||
menuItemRow.Click += new EventHandler(OnMenuItem_Click);
|
||||
e.Menu.Items.AddRange(new DXMenuCheckItem[] { menuItemCell, menuItemRow });
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user