Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
HZH_Controls
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit ebf3ac4d
由
冰封一夏
编写于
2019-11-19 15:10:14 +0800
由
Gitee
提交于
2019-11-19 15:10:14 +0800
浏览文件
选项
浏览文件
标签
下载
差异文件
!4 修正 UCDataGridView 的 ItemClick 事件 RowIndex 永远为 0
Merge pull request !4 from 熊本熊kumamon/master
2 个父辈
2847eef3
8c1159f1
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
22 行增加
和
2 行删除
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/Controls/DataGridView/IDataGridViewRow.cs
查看文件 @
ebf3ac4
...
@@ -82,5 +82,10 @@ namespace HZH_Controls.Controls
...
@@ -82,5 +82,10 @@ namespace HZH_Controls.Controls
/// </summary>
/// </summary>
/// <value>The height of the row.</value>
/// <value>The height of the row.</value>
int
RowHeight
{
get
;
set
;
}
int
RowHeight
{
get
;
set
;
}
/// <summary>
/// 行号
/// </summary>
/// <value>The Index of the row.</value>
int
RowIndex
{
get
;
set
;
}
}
}
}
}
HZH_Controls/HZH_Controls/Controls/DataGridView/UCDataGridView.cs
查看文件 @
ebf3ac4
...
@@ -510,6 +510,7 @@ namespace HZH_Controls.Controls
...
@@ -510,6 +510,7 @@ namespace HZH_Controls.Controls
item
.
BringToFront
();
item
.
BringToFront
();
Rows
.
Add
(
row
);
Rows
.
Add
(
row
);
row
.
RowIndex
=
Rows
.
IndexOf
(
row
);
}
}
intIndex
++;
intIndex
++;
}
}
...
@@ -533,7 +534,6 @@ namespace HZH_Controls.Controls
...
@@ -533,7 +534,6 @@ namespace HZH_Controls.Controls
row
.
ReloadCells
();
row
.
ReloadCells
();
row
.
BindingCellData
();
row
.
BindingCellData
();
Control
rowControl
=
(
row
as
Control
);
Control
rowControl
=
(
row
as
Control
);
row
.
RowHeight
=
m_rowHeight
;
row
.
RowHeight
=
m_rowHeight
;
rowControl
.
Dock
=
DockStyle
.
Top
;
rowControl
.
Dock
=
DockStyle
.
Top
;
...
@@ -542,6 +542,7 @@ namespace HZH_Controls.Controls
...
@@ -542,6 +542,7 @@ namespace HZH_Controls.Controls
row
.
RowCustomEvent
+=
(
a
,
b
)
=>
{
if
(
RowCustomEvent
!=
null
)
{
RowCustomEvent
(
a
,
b
);
}
};
row
.
RowCustomEvent
+=
(
a
,
b
)
=>
{
if
(
RowCustomEvent
!=
null
)
{
RowCustomEvent
(
a
,
b
);
}
};
row
.
SourceChanged
+=
RowSourceChanged
;
row
.
SourceChanged
+=
RowSourceChanged
;
Rows
.
Add
(
row
);
Rows
.
Add
(
row
);
row
.
RowIndex
=
Rows
.
IndexOf
(
row
);
this
.
panRow
.
Controls
.
Add
(
rowControl
);
this
.
panRow
.
Controls
.
Add
(
rowControl
);
rowControl
.
BringToFront
();
rowControl
.
BringToFront
();
...
...
HZH_Controls/HZH_Controls/Controls/DataGridView/UCDataGridViewRow.cs
查看文件 @
ebf3ac4
...
@@ -75,6 +75,12 @@ namespace HZH_Controls.Controls
...
@@ -75,6 +75,12 @@ namespace HZH_Controls.Controls
}
}
/// <summary>
/// <summary>
/// 行号
/// </summary>
/// <value>The Index of the row.</value>
public
int
RowIndex
{
get
;
set
;
}
/// <summary>
/// Gets or sets a value indicating whether this instance is show CheckBox.
/// Gets or sets a value indicating whether this instance is show CheckBox.
/// </summary>
/// </summary>
/// <value><c>true</c> if this instance is show CheckBox; otherwise, <c>false</c>.</value>
/// <value><c>true</c> if this instance is show CheckBox; otherwise, <c>false</c>.</value>
...
@@ -190,7 +196,8 @@ namespace HZH_Controls.Controls
...
@@ -190,7 +196,8 @@ namespace HZH_Controls.Controls
CellClick
(
this
,
new
DataGridViewEventArgs
()
CellClick
(
this
,
new
DataGridViewEventArgs
()
{
{
CellControl
=
this
,
CellControl
=
this
,
CellIndex
=
(
sender
as
Control
).
Tag
.
ToInt
()
CellIndex
=
(
sender
as
Control
).
Tag
.
ToInt
(),
RowIndex
=
this
.
RowIndex
});
});
}
}
}
}
...
@@ -249,6 +256,7 @@ namespace HZH_Controls.Controls
...
@@ -249,6 +256,7 @@ namespace HZH_Controls.Controls
{
{
CheckBoxChangeEvent
(
a
,
new
DataGridViewEventArgs
()
CheckBoxChangeEvent
(
a
,
new
DataGridViewEventArgs
()
{
{
RowIndex
=
this
.
RowIndex
,
CellControl
=
box
,
CellControl
=
box
,
CellIndex
=
0
CellIndex
=
0
});
});
...
...
HZH_Controls/HZH_Controls/Controls/DataGridView/UCDataGridViewTreeRow.cs
查看文件 @
ebf3ac4
...
@@ -75,6 +75,12 @@ namespace HZH_Controls.Controls
...
@@ -75,6 +75,12 @@ namespace HZH_Controls.Controls
}
}
/// <summary>
/// <summary>
/// 行号,树状图目前没有给予行号
/// </summary>
/// <value>The Index of the row.</value>
public
int
RowIndex
{
get
;
set
;
}
/// <summary>
/// Gets or sets a value indicating whether this instance is show CheckBox.
/// Gets or sets a value indicating whether this instance is show CheckBox.
/// </summary>
/// </summary>
/// <value><c>true</c> if this instance is show CheckBox; otherwise, <c>false</c>.</value>
/// <value><c>true</c> if this instance is show CheckBox; otherwise, <c>false</c>.</value>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论