0

I'm using Janus grid in C#, and I need to make a total sum by each row.

Column1 | Column2 | Total

       1          1         2

Thnx in advance.

user2800704
  • 57
  • 1
  • 3
  • 10

1 Answers1

1

you try this:

private void Grd_Detail_FormattingRow(object sender, Janus.Windows.GridEX.RowLoadEventArgs e)
{
    int i = 1;
    for (i = 0; i < Grd_Detail.RowCount; i++)
    {
            if (e.Row.RowType == Janus.Windows.GridEX.RowType.Record)
            {           
                 int s1=Int32.Parse(Grd_Detail.GetRow(i).Cells["Column1"].Value.ToString());
                 int s2=Int32.Parse(Grd_Detail.GetRow(i).Cells["Column2"].Value.ToString());      
                 Grd_Detail.GetRow(i).Cells["Column3"].Value=s1+s2;
            }
        }
    }
}
Arnold
  • 88
  • 1
  • 3
  • I get this error:{System.InvalidOperationException: Value can not be set. Values in cells can be set only if they belong to the current row in the GridEX control or a when an edit operation has been started with the BeginEdit method in the GridEXRow that owns the cell. – user2800704 Dec 02 '13 at 09:39
  • you need to add total cell before binding data – Arnold Dec 02 '13 at 11:45