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