* UIDataGridView: 不再判断DataSource绑定List为空,出现”索引-1没有值“用户自行判断
This commit is contained in:
parent
d1b3e3bcd6
commit
e415486a50
@ -30,10 +30,10 @@
|
|||||||
* 2022-01-21: V3.1.0 更新单选时选中值SelectedIndex值
|
* 2022-01-21: V3.1.0 更新单选时选中值SelectedIndex值
|
||||||
* 2022-04-16: V3.1.3 增加滚动条的颜色设置
|
* 2022-04-16: V3.1.3 增加滚动条的颜色设置
|
||||||
* 2022-04-26: V3.1.8 解决原生控件DataSource绑定List,并且List为空,出现”索引-1没有值“错误
|
* 2022-04-26: V3.1.8 解决原生控件DataSource绑定List,并且List为空,出现”索引-1没有值“错误
|
||||||
|
* 2022-06-10: V3.1.9 不再判断DataSource绑定List为空,出现”索引-1没有值“用户自行判断
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
@ -103,22 +103,22 @@ namespace Sunny.UI
|
|||||||
HorizontalScrollBar.VisibleChanged += HorizontalScrollBar_VisibleChanged;
|
HorizontalScrollBar.VisibleChanged += HorizontalScrollBar_VisibleChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
[
|
//[
|
||||||
DefaultValue(null),
|
// DefaultValue(null),
|
||||||
RefreshProperties(RefreshProperties.Repaint),
|
// RefreshProperties(RefreshProperties.Repaint),
|
||||||
AttributeProvider(typeof(IListSource)),
|
// AttributeProvider(typeof(IListSource)),
|
||||||
Description("提示 DataGridView 控件的数据源。")
|
// Description("提示 DataGridView 控件的数据源。")
|
||||||
]
|
//]
|
||||||
public new object DataSource
|
//public new object DataSource
|
||||||
{
|
//{
|
||||||
get => base.DataSource;
|
// get => base.DataSource;
|
||||||
set
|
// set
|
||||||
{
|
// {
|
||||||
//解决原生控件DataSource绑定List,并且List为空,出现”索引-1没有值“错误。
|
// //解决原生控件DataSource绑定List,并且List为空,出现”索引-1没有值“错误。
|
||||||
if (value is IList list && list.Count == 0) return;
|
// if (value is IList list && list.Count == 0) return;
|
||||||
base.DataSource = value;
|
// base.DataSource = value;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
[DefaultValue(false), Category("SunnyUI"), Description("禁止控件跟随窗体缩放")]
|
[DefaultValue(false), Category("SunnyUI"), Description("禁止控件跟随窗体缩放")]
|
||||||
public bool ZoomScaleDisabled { get; set; }
|
public bool ZoomScaleDisabled { get; set; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user