我在DataGridView属性Columns里添加了一个DataGridViewButtonColumn
Name为BuySellBtnBuySell然后我现在在RowPostPaint事件中想动态改变Button的标题,然后我就
DataGridViewRow dgr = dgvBuySell.Rows[e.RowIndex]
dgr.Cells["BuySellBtnBuySell"].Value = "买入";
可是Button的标题没有变,请问怎么写才可以变?谢谢!
Name为BuySellBtnBuySell然后我现在在RowPostPaint事件中想动态改变Button的标题,然后我就
DataGridViewRow dgr = dgvBuySell.Rows[e.RowIndex]
dgr.Cells["BuySellBtnBuySell"].Value = "买入";
可是Button的标题没有变,请问怎么写才可以变?谢谢!
{
DataGridViewRow dgr = this.dataGridView1.Rows[e.RowIndex];
dgr.Cells["Column1"].Value = "买入";
}
it is ok!why do not you fail?
{
if (dgr.Index >= dgvBuySell.Rows.Count - 1)
return;
dgr.Cells["BuySellBtnBuySell"].Value = "买入";
}这样就不会变了
this.BuySellBtnBuySell.UseColumnTextForButtonValue = true;