Commit 09e1bd73 kwwwvagaa

优化树表格显示

1 个父辈 6b547591
...@@ -507,6 +507,8 @@ namespace HZH_Controls.Controls ...@@ -507,6 +507,8 @@ namespace HZH_Controls.Controls
#endregion #endregion
#region 公共函数 #region 公共函数
/// <summary> /// <summary>
/// 刷新数据 /// 刷新数据
...@@ -779,7 +781,6 @@ namespace HZH_Controls.Controls ...@@ -779,7 +781,6 @@ namespace HZH_Controls.Controls
private void UCDataGridView_Paint(object sender, PaintEventArgs e) private void UCDataGridView_Paint(object sender, PaintEventArgs e)
{ {
} }
} }
} }
...@@ -50,13 +50,9 @@ namespace HZH_Controls.Controls ...@@ -50,13 +50,9 @@ namespace HZH_Controls.Controls
{ {
this.panCells = new System.Windows.Forms.TableLayoutPanel(); this.panCells = new System.Windows.Forms.TableLayoutPanel();
this.panLeft = new System.Windows.Forms.Panel(); this.panLeft = new System.Windows.Forms.Panel();
this.panChildGrid = new System.Windows.Forms.Panel();
this.ucDGVChild = new HZH_Controls.Controls.UCDataGridView();
this.ucSplitLine_V1 = new HZH_Controls.Controls.UCSplitLine_V();
this.panChildLeft = new System.Windows.Forms.Panel();
this.panMain = new System.Windows.Forms.Panel(); this.panMain = new System.Windows.Forms.Panel();
this.ucSplitLine_H1 = new HZH_Controls.Controls.UCSplitLine_H(); this.ucSplitLine_H1 = new HZH_Controls.Controls.UCSplitLine_H();
this.panChildGrid.SuspendLayout(); this.ucSplitLine_V1 = new HZH_Controls.Controls.UCSplitLine_V();
this.panMain.SuspendLayout(); this.panMain.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
...@@ -71,7 +67,7 @@ namespace HZH_Controls.Controls ...@@ -71,7 +67,7 @@ namespace HZH_Controls.Controls
this.panCells.RowCount = 1; this.panCells.RowCount = 1;
this.panCells.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.panCells.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.panCells.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 55F)); this.panCells.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 55F));
this.panCells.Size = new System.Drawing.Size(637, 64); this.panCells.Size = new System.Drawing.Size(636, 64);
this.panCells.TabIndex = 2; this.panCells.TabIndex = 2;
// //
// panLeft // panLeft
...@@ -85,89 +81,46 @@ namespace HZH_Controls.Controls ...@@ -85,89 +81,46 @@ namespace HZH_Controls.Controls
this.panLeft.Tag = "0"; this.panLeft.Tag = "0";
this.panLeft.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panLeft_MouseDown); this.panLeft.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panLeft_MouseDown);
// //
// panChildGrid
//
this.panChildGrid.Controls.Add(this.ucDGVChild);
this.panChildGrid.Controls.Add(this.ucSplitLine_V1);
this.panChildGrid.Controls.Add(this.panChildLeft);
this.panChildGrid.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panChildGrid.Location = new System.Drawing.Point(0, 65);
this.panChildGrid.Name = "panChildGrid";
this.panChildGrid.Size = new System.Drawing.Size(661, 0);
this.panChildGrid.TabIndex = 0;
this.panChildGrid.SizeChanged += new System.EventHandler(this.panChildGrid_SizeChanged);
//
// ucDGVChild
//
this.ucDGVChild.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.ucDGVChild.BackColor = System.Drawing.Color.White;
this.ucDGVChild.Columns = null;
this.ucDGVChild.DataSource = null;
this.ucDGVChild.HeadFont = new System.Drawing.Font("微软雅黑", 12F);
this.ucDGVChild.HeadHeight = 40;
this.ucDGVChild.HeadPadingLeft = 0;
this.ucDGVChild.HeadTextColor = System.Drawing.Color.Black;
this.ucDGVChild.IsShowCheckBox = false;
this.ucDGVChild.IsShowHead = false;
this.ucDGVChild.Location = new System.Drawing.Point(25, 0);
this.ucDGVChild.Name = "ucDGVChild";
this.ucDGVChild.RowHeight = 40;
this.ucDGVChild.RowType = typeof(HZH_Controls.Controls.UCDataGridViewRow);
this.ucDGVChild.Size = new System.Drawing.Size(636, 100);
this.ucDGVChild.TabIndex = 0;
this.ucDGVChild.SizeChanged += new System.EventHandler(this.ucDGVChild_SizeChanged);
//
// ucSplitLine_V1
//
this.ucSplitLine_V1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(232)))), ((int)(((byte)(232)))));
this.ucSplitLine_V1.Dock = System.Windows.Forms.DockStyle.Left;
this.ucSplitLine_V1.Location = new System.Drawing.Point(24, 0);
this.ucSplitLine_V1.Name = "ucSplitLine_V1";
this.ucSplitLine_V1.Size = new System.Drawing.Size(1, 0);
this.ucSplitLine_V1.TabIndex = 0;
this.ucSplitLine_V1.TabStop = false;
//
// panChildLeft
//
this.panChildLeft.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.panChildLeft.Dock = System.Windows.Forms.DockStyle.Left;
this.panChildLeft.Location = new System.Drawing.Point(0, 0);
this.panChildLeft.Name = "panChildLeft";
this.panChildLeft.Size = new System.Drawing.Size(24, 0);
this.panChildLeft.TabIndex = 1;
this.panChildLeft.Tag = "0";
//
// panMain // panMain
// //
this.panMain.Controls.Add(this.panCells); this.panMain.Controls.Add(this.panCells);
this.panMain.Controls.Add(this.panLeft); this.panMain.Controls.Add(this.panLeft);
this.panMain.Dock = System.Windows.Forms.DockStyle.Fill; this.panMain.Dock = System.Windows.Forms.DockStyle.Fill;
this.panMain.Location = new System.Drawing.Point(0, 0); this.panMain.Location = new System.Drawing.Point(1, 0);
this.panMain.Name = "panMain"; this.panMain.Name = "panMain";
this.panMain.Size = new System.Drawing.Size(661, 64); this.panMain.Size = new System.Drawing.Size(660, 64);
this.panMain.TabIndex = 0; this.panMain.TabIndex = 0;
// //
// ucSplitLine_H1 // ucSplitLine_H1
// //
this.ucSplitLine_H1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(232)))), ((int)(((byte)(232))))); this.ucSplitLine_H1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(232)))), ((int)(((byte)(232)))));
this.ucSplitLine_H1.Dock = System.Windows.Forms.DockStyle.Bottom; this.ucSplitLine_H1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.ucSplitLine_H1.Location = new System.Drawing.Point(0, 64); this.ucSplitLine_H1.Location = new System.Drawing.Point(1, 64);
this.ucSplitLine_H1.Name = "ucSplitLine_H1"; this.ucSplitLine_H1.Name = "ucSplitLine_H1";
this.ucSplitLine_H1.Size = new System.Drawing.Size(661, 1); this.ucSplitLine_H1.Size = new System.Drawing.Size(660, 1);
this.ucSplitLine_H1.TabIndex = 1; this.ucSplitLine_H1.TabIndex = 1;
this.ucSplitLine_H1.TabStop = false; this.ucSplitLine_H1.TabStop = false;
// //
// ucSplitLine_V1
//
this.ucSplitLine_V1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(232)))), ((int)(((byte)(232)))));
this.ucSplitLine_V1.Dock = System.Windows.Forms.DockStyle.Left;
this.ucSplitLine_V1.Location = new System.Drawing.Point(0, 0);
this.ucSplitLine_V1.Name = "ucSplitLine_V1";
this.ucSplitLine_V1.Size = new System.Drawing.Size(1, 65);
this.ucSplitLine_V1.TabIndex = 0;
this.ucSplitLine_V1.TabStop = false;
this.ucSplitLine_V1.Visible = false;
//
// UCDataGridViewTreeRow // UCDataGridViewTreeRow
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.White; this.BackColor = System.Drawing.Color.White;
this.Controls.Add(this.panMain); this.Controls.Add(this.panMain);
this.Controls.Add(this.ucSplitLine_H1); this.Controls.Add(this.ucSplitLine_H1);
this.Controls.Add(this.panChildGrid); this.Controls.Add(this.ucSplitLine_V1);
this.Name = "UCDataGridViewTreeRow"; this.Name = "UCDataGridViewTreeRow";
this.Size = new System.Drawing.Size(661, 65); this.Size = new System.Drawing.Size(661, 65);
this.panChildGrid.ResumeLayout(false);
this.panMain.ResumeLayout(false); this.panMain.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
...@@ -188,24 +141,9 @@ namespace HZH_Controls.Controls ...@@ -188,24 +141,9 @@ namespace HZH_Controls.Controls
/// </summary> /// </summary>
private System.Windows.Forms.Panel panLeft; private System.Windows.Forms.Panel panLeft;
/// <summary> /// <summary>
/// The pan child grid
/// </summary>
private System.Windows.Forms.Panel panChildGrid;
/// <summary>
/// The uc DGV child
/// </summary>
private UCDataGridView ucDGVChild;
/// <summary>
/// The pan child left
/// </summary>
private System.Windows.Forms.Panel panChildLeft;
/// <summary>
/// The pan main /// The pan main
/// </summary> /// </summary>
private System.Windows.Forms.Panel panMain; private System.Windows.Forms.Panel panMain;
/// <summary>
/// The uc split line v1
/// </summary>
private UCSplitLine_V ucSplitLine_V1; private UCSplitLine_V ucSplitLine_V1;
} }
} }
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
this.ucDataGridView1.BackColor = System.Drawing.Color.White; this.ucDataGridView1.BackColor = System.Drawing.Color.White;
this.ucDataGridView1.Columns = null; this.ucDataGridView1.Columns = null;
this.ucDataGridView1.DataSource = null; this.ucDataGridView1.DataSource = null;
this.ucDataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.ucDataGridView1.HeadFont = new System.Drawing.Font("微软雅黑", 12F); this.ucDataGridView1.HeadFont = new System.Drawing.Font("微软雅黑", 12F);
this.ucDataGridView1.HeadHeight = 40; this.ucDataGridView1.HeadHeight = 40;
this.ucDataGridView1.HeadPadingLeft = 0; this.ucDataGridView1.HeadPadingLeft = 0;
...@@ -47,13 +48,13 @@ ...@@ -47,13 +48,13 @@
this.ucDataGridView1.Name = "ucDataGridView1"; this.ucDataGridView1.Name = "ucDataGridView1";
this.ucDataGridView1.RowHeight = 41; this.ucDataGridView1.RowHeight = 41;
this.ucDataGridView1.RowType = typeof(HZH_Controls.Controls.UCDataGridViewRow); this.ucDataGridView1.RowType = typeof(HZH_Controls.Controls.UCDataGridViewRow);
this.ucDataGridView1.Size = new System.Drawing.Size(722, 583); this.ucDataGridView1.Size = new System.Drawing.Size(739, 599);
this.ucDataGridView1.TabIndex = 4; this.ucDataGridView1.TabIndex = 4;
// //
// UCTestGridTable // UCTestGridTable
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.Black; this.BackColor = System.Drawing.Color.Transparent;
this.Controls.Add(this.ucDataGridView1); this.Controls.Add(this.ucDataGridView1);
this.Name = "UCTestGridTable"; this.Name = "UCTestGridTable";
this.Size = new System.Drawing.Size(739, 599); this.Size = new System.Drawing.Size(739, 599);
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
this.ucDataGridView1.BackColor = System.Drawing.Color.White; this.ucDataGridView1.BackColor = System.Drawing.Color.White;
this.ucDataGridView1.Columns = null; this.ucDataGridView1.Columns = null;
this.ucDataGridView1.DataSource = null; this.ucDataGridView1.DataSource = null;
this.ucDataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.ucDataGridView1.HeadFont = new System.Drawing.Font("微软雅黑", 12F); this.ucDataGridView1.HeadFont = new System.Drawing.Font("微软雅黑", 12F);
this.ucDataGridView1.HeadHeight = 40; this.ucDataGridView1.HeadHeight = 40;
this.ucDataGridView1.HeadPadingLeft = 24; this.ucDataGridView1.HeadPadingLeft = 24;
...@@ -47,16 +48,16 @@ ...@@ -47,16 +48,16 @@
this.ucDataGridView1.Name = "ucDataGridView1"; this.ucDataGridView1.Name = "ucDataGridView1";
this.ucDataGridView1.RowHeight = 41; this.ucDataGridView1.RowHeight = 41;
this.ucDataGridView1.RowType = typeof(HZH_Controls.Controls.UCDataGridViewRow); this.ucDataGridView1.RowType = typeof(HZH_Controls.Controls.UCDataGridViewRow);
this.ucDataGridView1.Size = new System.Drawing.Size(807, 655); this.ucDataGridView1.Size = new System.Drawing.Size(817, 674);
this.ucDataGridView1.TabIndex = 5; this.ucDataGridView1.TabIndex = 5;
// //
// UCTestTreeGridTable // UCTestTreeGridTable
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.Black; this.BackColor = System.Drawing.Color.Transparent;
this.Controls.Add(this.ucDataGridView1); this.Controls.Add(this.ucDataGridView1);
this.Name = "UCTestTreeGridTable"; this.Name = "UCTestTreeGridTable";
this.Size = new System.Drawing.Size(825, 674); this.Size = new System.Drawing.Size(817, 674);
this.Load += new System.EventHandler(this.UCTestTreeGridTable_Load); this.Load += new System.EventHandler(this.UCTestTreeGridTable_Load);
this.ResumeLayout(false); this.ResumeLayout(false);
......
...@@ -23,7 +23,7 @@ namespace Test.UC ...@@ -23,7 +23,7 @@ namespace Test.UC
{ {
this.ucDataGridView1.RowType = typeof(UCDataGridViewTreeRow); this.ucDataGridView1.RowType = typeof(UCDataGridViewTreeRow);
List<DataGridViewColumnEntity> lstCulumns = new List<DataGridViewColumnEntity>(); List<DataGridViewColumnEntity> lstCulumns = new List<DataGridViewColumnEntity>();
lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "ID", HeadText = "编号", Width = 70, WidthType = SizeType.Absolute }); lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "ID", HeadText = "编号", Width = 100, WidthType = SizeType.Absolute });
lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "Name", HeadText = "姓名", Width = 150, WidthType = SizeType.Absolute }); lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "Name", HeadText = "姓名", Width = 150, WidthType = SizeType.Absolute });
lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "Age", HeadText = "年龄", Width = 150, WidthType = SizeType.Absolute }); lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "Age", HeadText = "年龄", Width = 150, WidthType = SizeType.Absolute });
lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "Birthday", HeadText = "生日", Width = 150, WidthType = SizeType.Absolute, Format = (a) => { return ((DateTime)a).ToString("yyyy-MM-dd"); } }); lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "Birthday", HeadText = "生日", Width = 150, WidthType = SizeType.Absolute, Format = (a) => { return ((DateTime)a).ToString("yyyy-MM-dd"); } });
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!