使用以下代码:
grid.Row = row;
grid.SetValue("ColumnName", ColumnValue );
Run Code Online (Sandbox Code Playgroud)
其中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";
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6925 次 |
| 最近记录: |