Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
HZH_Controls
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit f27f1d76
由
HZH
编写于
2019-08-27 16:00:28 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
add DataGridView RowCustomEvent
1 个父辈
2d9497ce
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
24 行增加
和
4 行删除
HZH_Controls/HZH_Controls/Controls/DataGridView/DataGridViewCellEventArgs.cs
HZH_Controls/HZH_Controls/Controls/DataGridView/DataGridViewCellEventHandler.cs
HZH_Controls/HZH_Controls/Controls/DataGridView/DataGridViewRowCustomEventArgs.cs
HZH_Controls/HZH_Controls/Controls/DataGridView/IDataGridViewRow.cs
HZH_Controls/HZH_Controls/Controls/DataGridView/UCDataGridView.cs
HZH_Controls/HZH_Controls/Controls/DataGridView/UCDataGridViewRow.cs
HZH_Controls/HZH_Controls/Controls/DataGridView/UCDataGridViewTreeRow.cs
HZH_Controls/HZH_Controls/HZH_Controls.csproj
HZH_Controls/Test/Form1.Designer.cs
HZH_Controls/HZH_Controls/Controls/DataGridView/DataGridViewCellEventArgs.cs
查看文件 @
f27f1d7
...
...
@@ -17,6 +17,5 @@ namespace HZH_Controls.Controls
public
int
CellIndex
{
get
;
set
;
}
public
int
RowIndex
{
get
;
set
;
}
}
}
HZH_Controls/HZH_Controls/Controls/DataGridView/DataGridViewCellEventHandler.cs
查看文件 @
f27f1d7
...
...
@@ -14,4 +14,8 @@ namespace HZH_Controls.Controls
[
Serializable
]
[
ComVisible
(
true
)]
public
delegate
void
DataGridViewEventHandler
(
object
sender
,
DataGridViewEventArgs
e
);
[
Serializable
]
[
ComVisible
(
true
)]
public
delegate
void
DataGridViewRowCustomEventHandler
(
object
sender
,
DataGridViewRowCustomEventArgs
e
);
}
HZH_Controls/HZH_Controls/Controls/DataGridView/DataGridViewRowCustomEventArgs.cs
0 → 100644
查看文件 @
f27f1d7
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
HZH_Controls.Controls
{
public
class
DataGridViewRowCustomEventArgs
:
EventArgs
{
public
string
EventName
{
get
;
set
;
}
}
}
HZH_Controls/HZH_Controls/Controls/DataGridView/IDataGridViewRow.cs
查看文件 @
f27f1d7
...
...
@@ -13,6 +13,7 @@ namespace HZH_Controls.Controls
{
public
interface
IDataGridViewRow
{
event
DataGridViewRowCustomEventHandler
RowCustomEvent
;
/// <summary>
/// CheckBox选中事件
/// </summary>
...
...
HZH_Controls/HZH_Controls/Controls/DataGridView/UCDataGridView.cs
查看文件 @
f27f1d7
...
...
@@ -309,6 +309,8 @@ namespace HZH_Controls.Controls
public
event
DataGridViewEventHandler
ItemClick
;
[
Description
(
"数据源改变事件"
),
Category
(
"自定义"
)]
public
event
DataGridViewEventHandler
SourceChanged
;
[
Description
(
"预留的自定义的事件,比如你需要在行上放置删改等按钮时,可以通过此事件传递出来"
),
Category
(
"自定义"
)]
public
event
DataGridViewRowCustomEventHandler
RowCustomEvent
;
#
endregion
#
endregion
...
...
@@ -505,6 +507,7 @@ namespace HZH_Controls.Controls
rowControl
.
Dock
=
DockStyle
.
Top
;
row
.
CellClick
+=
(
a
,
b
)
=>
{
SetSelectRow
((
Control
)
a
,
b
);
};
row
.
CheckBoxChangeEvent
+=
(
a
,
b
)
=>
{
SetSelectRow
(
rowControl
,
b
);
};
row
.
RowCustomEvent
+=
(
a
,
b
)
=>
{
if
(
RowCustomEvent
!=
null
)
{
RowCustomEvent
(
a
,
b
);
}
};
row
.
SourceChanged
+=
RowSourceChanged
;
rowControl
.
BringToFront
();
Rows
.
Add
(
row
);
...
...
HZH_Controls/HZH_Controls/Controls/DataGridView/UCDataGridViewRow.cs
查看文件 @
f27f1d7
...
...
@@ -20,7 +20,7 @@ namespace HZH_Controls.Controls
#
region
属性
public
event
DataGridViewEventHandler
CheckBoxChangeEvent
;
public
event
DataGridViewRowCustomEventHandler
RowCustomEvent
;
public
event
DataGridViewEventHandler
CellClick
;
public
event
DataGridViewEventHandler
SourceChanged
;
...
...
HZH_Controls/HZH_Controls/Controls/DataGridView/UCDataGridViewTreeRow.cs
查看文件 @
f27f1d7
...
...
@@ -19,7 +19,7 @@ namespace HZH_Controls.Controls
public
event
DataGridViewEventHandler
CellClick
;
public
event
DataGridViewEventHandler
SourceChanged
;
public
event
DataGridViewRowCustomEventHandler
RowCustomEvent
;
public
List
<
DataGridViewColumnEntity
>
Columns
{
get
;
...
...
HZH_Controls/HZH_Controls/HZH_Controls.csproj
查看文件 @
f27f1d7
...
...
@@ -58,6 +58,7 @@
<Compile Include="Controls\DataGridView\DataGridViewCellEventArgs.cs" />
<Compile Include="Controls\DataGridView\DataGridViewCellEventHandler.cs" />
<Compile Include="Controls\DataGridView\DataGridViewColumnEntity.cs" />
<Compile Include="Controls\DataGridView\DataGridViewRowCustomEventArgs.cs" />
<Compile Include="Controls\DataGridView\IDataGridViewRow.cs" />
<Compile Include="Controls\DataGridView\UCDataGridView.cs">
<SubType>UserControl</SubType>
...
...
HZH_Controls/Test/Form1.Designer.cs
查看文件 @
f27f1d7
...
...
@@ -939,7 +939,7 @@
this
.
ucBtnFillet1
.
BtnImage
=
((
System
.
Drawing
.
Image
)(
resources
.
GetObject
(
"ucBtnFillet1.BtnImage"
)));
this
.
ucBtnFillet1
.
BtnText
=
"按钮3 "
;
this
.
ucBtnFillet1
.
ConerRadius
=
10
;
this
.
ucBtnFillet1
.
FillColor
=
System
.
Drawing
.
Color
.
Blu
e
;
this
.
ucBtnFillet1
.
FillColor
=
System
.
Drawing
.
Color
.
Whit
e
;
this
.
ucBtnFillet1
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
15F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Pixel
);
this
.
ucBtnFillet1
.
ForeColor
=
System
.
Drawing
.
Color
.
White
;
this
.
ucBtnFillet1
.
IsRadius
=
true
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论