Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
HZH_Controls
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit f30bda0f
由
kwwwvagaa
编写于
2020-04-22 19:59:24 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
优化表格显示 支持横向滚动条
1 个父辈
68681cd7
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
118 行增加
和
28 行删除
HZH_Controls/HZH_Controls/Controls/DataGridView/UCDataGridView.Designer.cs
HZH_Controls/HZH_Controls/Controls/DataGridView/UCDataGridView.cs
HZH_Controls/HZH_Controls/Controls/DataGridView/UCDataGridView.resx
HZH_Controls/HZH_Controls/Controls/DataGridView/UCDataGridViewTreeRow.cs
HZH_Controls/Test/UC/UCTestGridTable.Designer.cs
HZH_Controls/Test/UC/UCTestGridTable.cs
HZH_Controls/Test/UC/UCTestSampling.cs
HZH_Controls/Test/UC/UCTestTreeGridTable.Designer.cs
HZH_Controls/Test/UC/UCTestTreeGridTable.cs
HZH_Controls/HZH_Controls/Controls/DataGridView/UCDataGridView.Designer.cs
查看文件 @
f30bda0
...
@@ -48,11 +48,13 @@ namespace HZH_Controls.Controls
...
@@ -48,11 +48,13 @@ namespace HZH_Controls.Controls
/// </summary>
/// </summary>
private
void
InitializeComponent
()
private
void
InitializeComponent
()
{
{
this
.
components
=
new
System
.
ComponentModel
.
Container
();
this
.
panHead
=
new
System
.
Windows
.
Forms
.
Panel
();
this
.
panHead
=
new
System
.
Windows
.
Forms
.
Panel
();
this
.
panColumns
=
new
System
.
Windows
.
Forms
.
TableLayoutPanel
();
this
.
panColumns
=
new
System
.
Windows
.
Forms
.
TableLayoutPanel
();
this
.
panHeadLeft
=
new
System
.
Windows
.
Forms
.
Panel
();
this
.
panHeadLeft
=
new
System
.
Windows
.
Forms
.
Panel
();
this
.
ucSplitLine_H1
=
new
HZH_Controls
.
Controls
.
UCSplitLine_H
();
this
.
panRow
=
new
System
.
Windows
.
Forms
.
Panel
();
this
.
panRow
=
new
System
.
Windows
.
Forms
.
Panel
();
this
.
timer1
=
new
System
.
Windows
.
Forms
.
Timer
(
this
.
components
);
this
.
ucSplitLine_H1
=
new
HZH_Controls
.
Controls
.
UCSplitLine_H
();
this
.
panHead
.
SuspendLayout
();
this
.
panHead
.
SuspendLayout
();
this
.
SuspendLayout
();
this
.
SuspendLayout
();
//
//
...
@@ -61,7 +63,6 @@ namespace HZH_Controls.Controls
...
@@ -61,7 +63,6 @@ namespace HZH_Controls.Controls
this
.
panHead
.
Controls
.
Add
(
this
.
panColumns
);
this
.
panHead
.
Controls
.
Add
(
this
.
panColumns
);
this
.
panHead
.
Controls
.
Add
(
this
.
panHeadLeft
);
this
.
panHead
.
Controls
.
Add
(
this
.
panHeadLeft
);
this
.
panHead
.
Controls
.
Add
(
this
.
ucSplitLine_H1
);
this
.
panHead
.
Controls
.
Add
(
this
.
ucSplitLine_H1
);
this
.
panHead
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Top
;
this
.
panHead
.
Location
=
new
System
.
Drawing
.
Point
(
0
,
0
);
this
.
panHead
.
Location
=
new
System
.
Drawing
.
Point
(
0
,
0
);
this
.
panHead
.
Name
=
"panHead"
;
this
.
panHead
.
Name
=
"panHead"
;
this
.
panHead
.
Size
=
new
System
.
Drawing
.
Size
(
1061
,
40
);
this
.
panHead
.
Size
=
new
System
.
Drawing
.
Size
(
1061
,
40
);
...
@@ -88,6 +89,18 @@ namespace HZH_Controls.Controls
...
@@ -88,6 +89,18 @@ namespace HZH_Controls.Controls
this
.
panHeadLeft
.
Size
=
new
System
.
Drawing
.
Size
(
0
,
39
);
this
.
panHeadLeft
.
Size
=
new
System
.
Drawing
.
Size
(
0
,
39
);
this
.
panHeadLeft
.
TabIndex
=
2
;
this
.
panHeadLeft
.
TabIndex
=
2
;
//
//
// panRow
//
this
.
panRow
.
Location
=
new
System
.
Drawing
.
Point
(
0
,
40
);
this
.
panRow
.
Name
=
"panRow"
;
this
.
panRow
.
Size
=
new
System
.
Drawing
.
Size
(
1061
,
525
);
this
.
panRow
.
TabIndex
=
1
;
//
// timer1
//
this
.
timer1
.
Interval
=
1
;
this
.
timer1
.
Tick
+=
new
System
.
EventHandler
(
this
.
timer1_Tick
);
//
// 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
)))));
...
@@ -98,24 +111,17 @@ namespace HZH_Controls.Controls
...
@@ -98,24 +111,17 @@ namespace HZH_Controls.Controls
this
.
ucSplitLine_H1
.
TabIndex
=
0
;
this
.
ucSplitLine_H1
.
TabIndex
=
0
;
this
.
ucSplitLine_H1
.
TabStop
=
false
;
this
.
ucSplitLine_H1
.
TabStop
=
false
;
//
//
// panRow
//
this
.
panRow
.
AutoScroll
=
true
;
this
.
panRow
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Fill
;
this
.
panRow
.
Location
=
new
System
.
Drawing
.
Point
(
0
,
40
);
this
.
panRow
.
Name
=
"panRow"
;
this
.
panRow
.
Size
=
new
System
.
Drawing
.
Size
(
1061
,
525
);
this
.
panRow
.
TabIndex
=
1
;
//
// UCDataGridView
// UCDataGridView
//
//
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
None
;
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
None
;
this
.
AutoScroll
=
true
;
this
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
Controls
.
Add
(
this
.
panRow
);
this
.
Controls
.
Add
(
this
.
panHead
);
this
.
Controls
.
Add
(
this
.
panHead
);
this
.
Controls
.
Add
(
this
.
panRow
);
this
.
Name
=
"UCDataGridView"
;
this
.
Name
=
"UCDataGridView"
;
this
.
Size
=
new
System
.
Drawing
.
Size
(
1061
,
565
);
this
.
Size
=
new
System
.
Drawing
.
Size
(
1061
,
565
);
this
.
Scroll
+=
new
System
.
Windows
.
Forms
.
ScrollEventHandler
(
this
.
UCDataGridView_Scroll
);
this
.
SizeChanged
+=
new
System
.
EventHandler
(
this
.
UCDataGridView_SizeChanged
);
this
.
Paint
+=
new
System
.
Windows
.
Forms
.
PaintEventHandler
(
this
.
UCDataGridView_Paint
);
this
.
panHead
.
ResumeLayout
(
false
);
this
.
panHead
.
ResumeLayout
(
false
);
this
.
ResumeLayout
(
false
);
this
.
ResumeLayout
(
false
);
...
@@ -143,6 +149,7 @@ namespace HZH_Controls.Controls
...
@@ -143,6 +149,7 @@ namespace HZH_Controls.Controls
/// The pan head left
/// The pan head left
/// </summary>
/// </summary>
private
System
.
Windows
.
Forms
.
Panel
panHeadLeft
;
private
System
.
Windows
.
Forms
.
Panel
panHeadLeft
;
private
System
.
Windows
.
Forms
.
Timer
timer1
;
}
}
}
}
HZH_Controls/HZH_Controls/Controls/DataGridView/UCDataGridView.cs
查看文件 @
f30bda0
...
@@ -96,8 +96,21 @@ namespace HZH_Controls.Controls
...
@@ -96,8 +96,21 @@ namespace HZH_Controls.Controls
get
{
return
m_isShowHead
;
}
get
{
return
m_isShowHead
;
}
set
set
{
{
if
(
m_isShowHead
!=
value
)
{
m_isShowHead
=
value
;
m_isShowHead
=
value
;
panHead
.
Visible
=
value
;
panHead
.
Visible
=
value
;
if
(
value
)
{
this
.
panRow
.
Location
=
new
Point
(
0
,
panHead
.
Height
);
this
.
panRow
.
Height
=
this
.
panRow
.
Height
-
panHead
.
Height
;
}
else
{
this
.
panRow
.
Location
=
new
Point
(
0
,
0
);
this
.
panRow
.
Height
=
this
.
panRow
.
Height
+
panHead
.
Height
;
}
}
}
}
}
}
/// <summary>
/// <summary>
...
@@ -391,12 +404,48 @@ namespace HZH_Controls.Controls
...
@@ -391,12 +404,48 @@ namespace HZH_Controls.Controls
{
return
;
}
{
return
;
}
ControlHelper
.
FreezeControl
(
this
.
panHead
,
true
);
ControlHelper
.
FreezeControl
(
this
.
panHead
,
true
);
this
.
panRow
.
Controls
.
Clear
();
this
.
panRow
.
Controls
.
Clear
();
this
.
panColumns
.
Controls
.
Clear
();
this
.
panColumns
.
Controls
.
Clear
();
this
.
panColumns
.
ColumnStyles
.
Clear
();
this
.
panColumns
.
ColumnStyles
.
Clear
();
if
(
m_columns
!=
null
&&
m_columns
.
Count
()
>
0
)
if
(
m_columns
!=
null
&&
m_columns
.
Count
()
>
0
)
{
{
int
_width
=
0
;
m_columns
.
ForEach
(
p
=>
{
if
(
p
.
WidthType
==
SizeType
.
Absolute
)
{
_width
+=
p
.
Width
;
}
else
if
(
p
.
WidthType
==
SizeType
.
Percent
)
{
_width
+=
(
int
)((
p
.
Width
/
100f
)
*
this
.
Width
);
}
});
if
(
m_isShowCheckBox
)
_width
+=
30
;
if
(
_width
>
this
.
Width
)
{
this
.
panRow
.
Width
=
_width
;
this
.
panHead
.
Width
=
_width
;
}
else
{
if
(
m_columns
.
Any
(
p
=>
p
.
WidthType
==
SizeType
.
AutoSize
))
{
this
.
panRow
.
Width
=
this
.
Width
;
this
.
panHead
.
Width
=
this
.
Width
;
}
else
{
this
.
panRow
.
Width
=
_width
;
this
.
panHead
.
Width
=
_width
;
}
}
m_columns
.
FindAll
(
p
=>
p
.
WidthType
==
SizeType
.
Absolute
);
m_columns
.
FindAll
(
p
=>
p
.
WidthType
==
SizeType
.
Percent
);
int
intColumnsCount
=
m_columns
.
Count
();
int
intColumnsCount
=
m_columns
.
Count
();
if
(
m_isShowCheckBox
)
if
(
m_isShowCheckBox
)
{
{
...
@@ -469,6 +518,7 @@ namespace HZH_Controls.Controls
...
@@ -469,6 +518,7 @@ namespace HZH_Controls.Controls
try
try
{
{
ControlHelper
.
FreezeControl
(
this
,
true
);
ControlHelper
.
FreezeControl
(
this
,
true
);
panHead
.
Location
=
new
Point
(
0
,
0
);
Rows
=
new
List
<
IDataGridViewRow
>();
Rows
=
new
List
<
IDataGridViewRow
>();
if
(
m_columns
==
null
||
m_columns
.
Count
<=
0
)
if
(
m_columns
==
null
||
m_columns
.
Count
<=
0
)
return
;
return
;
...
@@ -549,6 +599,8 @@ namespace HZH_Controls.Controls
...
@@ -549,6 +599,8 @@ namespace HZH_Controls.Controls
}
}
}
}
this
.
panRow
.
Height
=
intSourceCount
*
RowHeight
;
}
}
else
else
{
{
...
@@ -710,5 +762,34 @@ namespace HZH_Controls.Controls
...
@@ -710,5 +762,34 @@ namespace HZH_Controls.Controls
#
endregion
#
endregion
private
void
UCDataGridView_SizeChanged
(
object
sender
,
EventArgs
e
)
{
//LoadColumns();
//ReloadSource();
}
private
void
UCDataGridView_Scroll
(
object
sender
,
ScrollEventArgs
e
)
{
if
(
e
.
ScrollOrientation
==
ScrollOrientation
.
VerticalScroll
)
{
panHead
.
Location
=
new
Point
(
0
,
this
.
VerticalScroll
.
Value
+
this
.
panRow
.
Location
.
Y
-
panHead
.
Height
-
2
);
timer1
.
Enabled
=
true
;
scrollIndex
=
0
;
}
}
private
void
UCDataGridView_Paint
(
object
sender
,
PaintEventArgs
e
)
{
}
int
scrollIndex
=
0
;
private
void
timer1_Tick
(
object
sender
,
EventArgs
e
)
{
if
(
scrollIndex
>
1000
)
timer1
.
Enabled
=
false
;
panHead
.
Location
=
new
Point
(
0
,
this
.
VerticalScroll
.
Value
+
this
.
panRow
.
Location
.
Y
-
panHead
.
Height
-
2
);
scrollIndex
++;
}
}
}
}
}
HZH_Controls/HZH_Controls/Controls/DataGridView/UCDataGridView.resx
查看文件 @
f30bda0
...
@@ -117,4 +117,7 @@
...
@@ -117,4 +117,7 @@
<resheader name="writer">
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</resheader>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
</root>
\ No newline at end of file
\ No newline at end of file
HZH_Controls/HZH_Controls/Controls/DataGridView/UCDataGridViewTreeRow.cs
查看文件 @
f30bda0
...
@@ -155,7 +155,7 @@ namespace HZH_Controls.Controls
...
@@ -155,7 +155,7 @@ namespace HZH_Controls.Controls
});
});
}
}
};
};
this
.
ucDGVChild
.
AutoScroll
=
false
;
}
}
/// <summary>
/// <summary>
...
...
HZH_Controls/Test/UC/UCTestGridTable.Designer.cs
查看文件 @
f30bda0
...
@@ -33,10 +33,10 @@
...
@@ -33,10 +33,10 @@
//
//
// ucDataGridView1
// ucDataGridView1
//
//
this
.
ucDataGridView1
.
AutoScroll
=
true
;
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 +47,13 @@
...
@@ -47,13 +47,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
(
7
39
,
599
);
this
.
ucDataGridView1
.
Size
=
new
System
.
Drawing
.
Size
(
7
22
,
583
);
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
.
White
;
this
.
BackColor
=
System
.
Drawing
.
Color
.
Black
;
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
);
...
...
HZH_Controls/Test/UC/UCTestGridTable.cs
查看文件 @
f30bda0
...
@@ -25,8 +25,8 @@ namespace Test.UC
...
@@ -25,8 +25,8 @@ namespace Test.UC
lstCulumns
.
Add
(
new
DataGridViewColumnEntity
()
{
DataField
=
"ID"
,
HeadText
=
"编号"
,
Width
=
70
,
WidthType
=
SizeType
.
Absolute
});
lstCulumns
.
Add
(
new
DataGridViewColumnEntity
()
{
DataField
=
"ID"
,
HeadText
=
"编号"
,
Width
=
70
,
WidthType
=
SizeType
.
Absolute
});
lstCulumns
.
Add
(
new
DataGridViewColumnEntity
()
{
DataField
=
"Name"
,
HeadText
=
"姓名"
,
Width
=
100
,
WidthType
=
SizeType
.
Absolute
});
lstCulumns
.
Add
(
new
DataGridViewColumnEntity
()
{
DataField
=
"Name"
,
HeadText
=
"姓名"
,
Width
=
100
,
WidthType
=
SizeType
.
Absolute
});
lstCulumns
.
Add
(
new
DataGridViewColumnEntity
()
{
DataField
=
"Age"
,
HeadText
=
"年龄"
,
Width
=
500
,
WidthType
=
SizeType
.
Absolute
});
lstCulumns
.
Add
(
new
DataGridViewColumnEntity
()
{
DataField
=
"Age"
,
HeadText
=
"年龄"
,
Width
=
500
,
WidthType
=
SizeType
.
Absolute
});
lstCulumns
.
Add
(
new
DataGridViewColumnEntity
()
{
DataField
=
"Birthday"
,
HeadText
=
"生日"
,
Width
=
50
0
,
WidthType
=
SizeType
.
Absolute
,
Format
=
(
a
)
=>
{
return
((
DateTime
)
a
).
ToString
(
"yyyy-MM-dd"
);
}
});
lstCulumns
.
Add
(
new
DataGridViewColumnEntity
()
{
DataField
=
"Birthday"
,
HeadText
=
"生日"
,
Width
=
15
0
,
WidthType
=
SizeType
.
Absolute
,
Format
=
(
a
)
=>
{
return
((
DateTime
)
a
).
ToString
(
"yyyy-MM-dd"
);
}
});
lstCulumns
.
Add
(
new
DataGridViewColumnEntity
()
{
DataField
=
"Sex"
,
HeadText
=
"性别"
,
Width
=
50
0
,
WidthType
=
SizeType
.
Absolute
,
Format
=
(
a
)
=>
{
return
((
int
)
a
)
==
0
?
"女"
:
"男"
;
}
});
lstCulumns
.
Add
(
new
DataGridViewColumnEntity
()
{
DataField
=
"Sex"
,
HeadText
=
"性别"
,
Width
=
50
,
WidthType
=
SizeType
.
Absolute
,
Format
=
(
a
)
=>
{
return
((
int
)
a
)
==
0
?
"女"
:
"男"
;
}
});
this
.
ucDataGridView1
.
Columns
=
lstCulumns
;
this
.
ucDataGridView1
.
Columns
=
lstCulumns
;
this
.
ucDataGridView1
.
IsShowCheckBox
=
true
;
this
.
ucDataGridView1
.
IsShowCheckBox
=
true
;
List
<
object
>
lstSource
=
new
List
<
object
>();
List
<
object
>
lstSource
=
new
List
<
object
>();
...
...
HZH_Controls/Test/UC/UCTestSampling.cs
查看文件 @
f30bda0
...
@@ -40,6 +40,5 @@ namespace Test.UC
...
@@ -40,6 +40,5 @@ namespace Test.UC
e
.
Graphics
.
FillPath
(
new
SolidBrush
(
Color
.
FromArgb
(
50
,
Color
.
White
)),
uc
.
BorderPath
);
e
.
Graphics
.
FillPath
(
new
SolidBrush
(
Color
.
FromArgb
(
50
,
Color
.
White
)),
uc
.
BorderPath
);
}
}
}
}
}
}
}
}
HZH_Controls/Test/UC/UCTestTreeGridTable.Designer.cs
查看文件 @
f30bda0
...
@@ -33,10 +33,10 @@
...
@@ -33,10 +33,10 @@
//
//
// ucDataGridView1
// ucDataGridView1
//
//
this
.
ucDataGridView1
.
AutoScroll
=
true
;
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,13 +47,13 @@
...
@@ -47,13 +47,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
(
8
25
,
674
);
this
.
ucDataGridView1
.
Size
=
new
System
.
Drawing
.
Size
(
8
07
,
655
);
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
.
White
;
this
.
BackColor
=
System
.
Drawing
.
Color
.
Black
;
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
(
825
,
674
);
...
...
HZH_Controls/Test/UC/UCTestTreeGridTable.cs
查看文件 @
f30bda0
...
@@ -24,10 +24,10 @@ namespace Test.UC
...
@@ -24,10 +24,10 @@ 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
=
70
,
WidthType
=
SizeType
.
Absolute
});
lstCulumns
.
Add
(
new
DataGridViewColumnEntity
()
{
DataField
=
"Name"
,
HeadText
=
"姓名"
,
Width
=
50
,
WidthType
=
SizeType
.
Percent
});
lstCulumns
.
Add
(
new
DataGridViewColumnEntity
()
{
DataField
=
"Name"
,
HeadText
=
"姓名"
,
Width
=
150
,
WidthType
=
SizeType
.
Absolute
});
lstCulumns
.
Add
(
new
DataGridViewColumnEntity
()
{
DataField
=
"Age"
,
HeadText
=
"年龄"
,
Width
=
50
,
WidthType
=
SizeType
.
Percent
});
lstCulumns
.
Add
(
new
DataGridViewColumnEntity
()
{
DataField
=
"Age"
,
HeadText
=
"年龄"
,
Width
=
150
,
WidthType
=
SizeType
.
Absolute
});
lstCulumns
.
Add
(
new
DataGridViewColumnEntity
()
{
DataField
=
"Birthday"
,
HeadText
=
"生日"
,
Width
=
50
,
WidthType
=
SizeType
.
Percent
,
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"
);
}
});
lstCulumns
.
Add
(
new
DataGridViewColumnEntity
()
{
DataField
=
"Sex"
,
HeadText
=
"性别"
,
Width
=
50
,
WidthType
=
SizeType
.
Percent
,
Format
=
(
a
)
=>
{
return
((
int
)
a
)
==
0
?
"女"
:
"男"
;
}
});
lstCulumns
.
Add
(
new
DataGridViewColumnEntity
()
{
DataField
=
"Sex"
,
HeadText
=
"性别"
,
Width
=
150
,
WidthType
=
SizeType
.
Absolute
,
Format
=
(
a
)
=>
{
return
((
int
)
a
)
==
0
?
"女"
:
"男"
;
}
});
this
.
ucDataGridView1
.
Columns
=
lstCulumns
;
this
.
ucDataGridView1
.
Columns
=
lstCulumns
;
this
.
ucDataGridView1
.
IsShowCheckBox
=
true
;
this
.
ucDataGridView1
.
IsShowCheckBox
=
true
;
List
<
object
>
lstSource
=
new
List
<
object
>();
List
<
object
>
lstSource
=
new
List
<
object
>();
...
@@ -59,7 +59,7 @@ namespace Test.UC
...
@@ -59,7 +59,7 @@ namespace Test.UC
{
{
ID
=
i
.
ToString
(),
ID
=
i
.
ToString
(),
Age
=
3
*
i
,
Age
=
3
*
i
,
Name
=
intCount
+
"
——"
+
i
,
Name
=
"姓名
——"
+
i
,
Birthday
=
DateTime
.
Now
.
AddYears
(-
10
),
Birthday
=
DateTime
.
Now
.
AddYears
(-
10
),
Sex
=
i
%
2
Sex
=
i
%
2
};
};
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论