This commit is contained in:
@@ -5,6 +5,7 @@ using Sunny.UI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
@@ -121,18 +122,22 @@ namespace 全自动水压检测仪
|
||||
dataGridView.ScrollBars = ScrollBars.Both;
|
||||
|
||||
|
||||
// ============ 添加编辑按钮列(放在第一列) ============
|
||||
DataGridViewButtonColumn editColumn = new DataGridViewButtonColumn
|
||||
var config = ConfigurationManager.AppSettings;
|
||||
if (config["AllowModified"]?.ToString() == "1")
|
||||
{
|
||||
Name = "EditColumn",
|
||||
HeaderText = "操作",
|
||||
Text = "保存",
|
||||
UseColumnTextForButtonValue = true,
|
||||
Width = 60,
|
||||
SortMode = DataGridViewColumnSortMode.NotSortable,
|
||||
DefaultCellStyle = { Alignment = DataGridViewContentAlignment.MiddleCenter }
|
||||
};
|
||||
dataGridView.Columns.Add(editColumn);
|
||||
// ============ 添加编辑按钮列(放在第一列) ============
|
||||
DataGridViewButtonColumn editColumn = new DataGridViewButtonColumn
|
||||
{
|
||||
Name = "EditColumn",
|
||||
HeaderText = "操作",
|
||||
Text = "保存",
|
||||
UseColumnTextForButtonValue = true,
|
||||
Width = 60,
|
||||
SortMode = DataGridViewColumnSortMode.NotSortable,
|
||||
DefaultCellStyle = { Alignment = DataGridViewContentAlignment.MiddleCenter }
|
||||
};
|
||||
dataGridView.Columns.Add(editColumn);
|
||||
}
|
||||
|
||||
dataGridView.Columns.Add(new DataGridViewTextBoxColumn
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user