Commit ebf3ac4d 冰封一夏 Gitee 提交于

!4 修正 UCDataGridView 的 ItemClick 事件 RowIndex 永远为 0

Merge pull request !4 from 熊本熊kumamon/master
2 个父辈 2847eef3 8c1159f1
......@@ -82,5 +82,10 @@ namespace HZH_Controls.Controls
/// </summary>
/// <value>The height of the row.</value>
int RowHeight { get; set; }
/// <summary>
/// 行号
/// </summary>
/// <value>The Index of the row.</value>
int RowIndex { get; set; }
}
}
......@@ -510,6 +510,7 @@ namespace HZH_Controls.Controls
item.BringToFront();
Rows.Add(row);
row.RowIndex = Rows.IndexOf(row);
}
intIndex++;
}
......@@ -533,8 +534,7 @@ namespace HZH_Controls.Controls
row.ReloadCells();
row.BindingCellData();
Control rowControl = (row as Control);
Control rowControl = (row as Control);
row.RowHeight = m_rowHeight;
rowControl.Dock = DockStyle.Top;
row.CellClick += (a, b) => { SetSelectRow(rowControl, b); };
......@@ -542,6 +542,7 @@ namespace HZH_Controls.Controls
row.RowCustomEvent += (a, b) => { if (RowCustomEvent != null) { RowCustomEvent(a, b); } };
row.SourceChanged += RowSourceChanged;
Rows.Add(row);
row.RowIndex = Rows.IndexOf(row);
this.panRow.Controls.Add(rowControl);
rowControl.BringToFront();
......
......@@ -75,6 +75,12 @@ namespace HZH_Controls.Controls
}
/// <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.
/// </summary>
/// <value><c>true</c> if this instance is show CheckBox; otherwise, <c>false</c>.</value>
......@@ -166,7 +172,7 @@ namespace HZH_Controls.Controls
}
}
}
}
}
}
foreach (Control item in this.panCells.Controls)
{
......@@ -190,7 +196,8 @@ namespace HZH_Controls.Controls
CellClick(this, new DataGridViewEventArgs()
{
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
{
CheckBoxChangeEvent(a, new DataGridViewEventArgs()
{
RowIndex = this.RowIndex,
CellControl = box,
CellIndex = 0
});
......@@ -277,9 +285,9 @@ namespace HZH_Controls.Controls
};
c = lbl;
}
else
else
{
Control cc = (Control)Activator.CreateInstance(item.CustomCellType);
Control cc = (Control)Activator.CreateInstance(item.CustomCellType);
cc.Dock = DockStyle.Fill;
c = cc;
}
......
......@@ -75,6 +75,12 @@ namespace HZH_Controls.Controls
}
/// <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.
/// </summary>
/// <value><c>true</c> if this instance is show CheckBox; otherwise, <c>false</c>.</value>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!