我需要在运行时更改janus gridex单元格值吗?
例如 :
原始单元格值=> 0运行时单元格值=>允许
这项工作在默认的datagridview中在事件cellformatting中.但janus gridex中不存在cellformatting事件
使用以下代码:
grid.Row = row; grid.SetValue("ColumnName", ColumnValue );
其中row是要更改其单元格值的行,"ColumnName":是列Key,ColumnValue是您要为此单元格指定的值
如果要更改FormattingRow事件中的值,请使用以下代码:
private void gridProject_FormattingRow(object sender, RowLoadEventArgs e) { string s = e.Row.Cells["Status"].Value.ToString(); if (s == "True") { if (e.Row.RowType == Janus.Windows.GridEX.RowType.Record) { Janus.Windows.GridEX.GridEXFormatStyle rowcol = new GridEXFormatStyle(); rowcol.BackColor = Color.LightGreen; e.Row.RowStyle = rowcol; } e.Row.Cells["Status"].Text = "yes"; } else { e.Row.Cells["Status"].Text = "no"; } }