Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
HZH_Controls
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit f8a884f8
由
熊本熊kumamon
编写于
2019-12-05 16:34:42 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
修正 UCDataGridView 的 DataSource 是 DataTable 資料無法正常顯示
1 个父辈
add05d52
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
16 行增加
和
1 行删除
HZH_Controls/HZH_Controls/Controls/DataGridView/UCDataGridView.cs
HZH_Controls/HZH_Controls/Controls/DataGridView/UCDataGridViewRow.cs
HZH_Controls/HZH_Controls/Controls/DataGridView/UCDataGridView.cs
查看文件 @
f8a884f
...
@@ -207,7 +207,7 @@ namespace HZH_Controls.Controls
...
@@ -207,7 +207,7 @@ namespace HZH_Controls.Controls
{
{
if
(
value
!=
null
)
if
(
value
!=
null
)
{
{
if
(!(
m_dataSourc
e
is
DataTable
)
&&
(!
typeof
(
IList
).
IsAssignableFrom
(
value
.
GetType
())))
if
(!(
valu
e
is
DataTable
)
&&
(!
typeof
(
IList
).
IsAssignableFrom
(
value
.
GetType
())))
{
{
throw
new
Exception
(
"数据源不是有效的数据类型,请使用Datatable或列表"
);
throw
new
Exception
(
"数据源不是有效的数据类型,请使用Datatable或列表"
);
}
}
...
...
HZH_Controls/HZH_Controls/Controls/DataGridView/UCDataGridViewRow.cs
查看文件 @
f8a884f
...
@@ -158,7 +158,21 @@ namespace HZH_Controls.Controls
...
@@ -158,7 +158,21 @@ namespace HZH_Controls.Controls
var
cs
=
this
.
panCells
.
Controls
.
Find
(
"lbl_"
+
com
.
DataField
,
false
);
var
cs
=
this
.
panCells
.
Controls
.
Find
(
"lbl_"
+
com
.
DataField
,
false
);
if
(
cs
!=
null
&&
cs
.
Length
>
0
)
if
(
cs
!=
null
&&
cs
.
Length
>
0
)
{
{
if
(
DataSource
is
DataRow
row
)
{
if
(
com
.
Format
!=
null
)
{
cs
[
0
].
Text
=
com
.
Format
(
row
[
com
.
DataField
]);
}
else
{
cs
[
0
].
Text
=
row
[
com
.
DataField
].
ToStringExt
();
}
}
else
{
var
pro
=
DataSource
.
GetType
().
GetProperty
(
com
.
DataField
);
var
pro
=
DataSource
.
GetType
().
GetProperty
(
com
.
DataField
);
if
(
pro
!=
null
)
if
(
pro
!=
null
)
{
{
var
value
=
pro
.
GetValue
(
DataSource
,
null
);
var
value
=
pro
.
GetValue
(
DataSource
,
null
);
...
@@ -174,6 +188,7 @@ namespace HZH_Controls.Controls
...
@@ -174,6 +188,7 @@ namespace HZH_Controls.Controls
}
}
}
}
}
}
}
foreach
(
Control
item
in
this
.
panCells
.
Controls
)
foreach
(
Control
item
in
this
.
panCells
.
Controls
)
{
{
if
(
item
is
IDataGridViewCustomCell
)
if
(
item
is
IDataGridViewCustomCell
)
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论