Skip to main content Skip to footer

Set format for Footer cells in C1FlexGrid

Background:

How to set format for Footer cells in FlexGrid

Steps to Complete:

The format property of the Column class in FlexGrid is not applied to the Footer cells of that Column. In order to set the format for footer cells explicitly, you can handle the grid’s OwnerDrawCell event as given in the code snippet below:

private void C1FlexGrid1_OwnerDrawCell(object sender, OwnerDrawCellEventArgs e)
{
 if (e.Col == c1FlexGrid1.Cols["ColumnName"].Index && e.Row == c1FlexGrid1.Rows.Count - 1)
 {
   double d = Convert.ToDouble(e.Text);
   e.Text = String.Format("{0:#,##0.00}",d);  
 }
}

Prabhat Sharma