gpt4 book ai didi

c# - janus gridex 在运行时更改单元格值?

转载 作者:太空宇宙 更新时间:2023-11-03 20:10:33 24 4
gpt4 key购买 nike

我需要在运行时更改 janus gridex 单元格值吗?

例如:

原始单元格值=> 0运行时单元值 => 允许

这工作在默认的 datagridview 事件 cellformatting 中。但在 janus gridex 中不存在 cellformatting 事件

最佳答案

使用以下代码:

grid.Row = row;
grid.SetValue("ColumnName", ColumnValue );

其中 row 是您要更改其单元格值的行,“ColumnName”:是列键,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";
}
}

关于c# - janus gridex 在运行时更改单元格值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20333506/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com