通过点击我的任何标题对数据网格视图进行排序时,我的按钮文字消失
var MoreInfoCol = new DataGridViewButtonColumn();
MoreInfoCol.Name = "MoreInfoColumn";
MoreInfoCol.HeaderText = "Extended Description";
dataGRID.Columns.Add(MoreInfoCol);
foreach (DataGridViewRow row in dataGRID.Rows)
{
row.Cells["MoreInfoColumn"].Value = row.Cells[2].Value.ToString() + " | More Info";
dataGRID.CellContentClick += new DataGridViewCellEventHandler(dataGRID_CellContentClick);
}
答案 0 :(得分:0)
我想通了
MoreInfoCol.UseColumnTextForButtonValue = true;
MoreInfoCol.Text = "My Value Goes here";