Commit 385f3f0a HZH

数据源为空时错误

1 个父辈 a5648005
...@@ -417,12 +417,19 @@ namespace HZH_Controls.Controls ...@@ -417,12 +417,19 @@ namespace HZH_Controls.Controls
if (Page == null) if (Page == null)
{ {
if (((IList)m_dataSource).Count > intCount) if (m_dataSource == null)
{ {
intXCount = (this.panMain.Width - 10 - 20) / (item.Width + 10); intCount = 0;
m_intCellWidth = item.Width + ((this.panMain.Width - 10 - 20) % (item.Width + 10)) / intXCount; }
else
{
if (((IList)m_dataSource).Count > intCount)
{
intXCount = (this.panMain.Width - 10 - 20) / (item.Width + 10);
m_intCellWidth = item.Width + ((this.panMain.Width - 10 - 20) % (item.Width + 10)) / intXCount;
}
intCount = Math.Max(intCount, ((IList)m_dataSource).Count);
} }
intCount = Math.Max(intCount, ((IList)m_dataSource).Count);
} }
CellCount = intCount; CellCount = intCount;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!