Mostafa
Mostafa

Reputation: 111

janus gridex change cell value at runtime?

I need to change janus gridex cell value at runtime ?

for example :

original cell value => 0 runtime cell value => allow

This work in default datagridview In the event cellformatting . but not exist cellformatting event in the janus gridex

Upvotes: 2

Views: 9510

Answers (1)

Adel Khayata
Adel Khayata

Reputation: 2836

Use the following code:

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

Where row is the row that you want to change its cell's values, "ColumnName": is the column Key and ColumnValue is the value you want to assign for this cell

If you want to change the value in the FormattingRow event, use the following code:

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";
     }
}

Upvotes: 6

Related Questions