We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Dynamic change cell format

I am trying to dynamic change cell format to overide the column format, but getting nowhere.

Somewhere after InitializeComponent() I have

((SCAGridColumnDescriptor)(this.grid1.TableDescriptor.Columns["A"])).Appearance.AnyRecordFieldCell.Format = "#,###;-#,###;0";

Then I have a grid1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)

Here I have e.Style.Format = "#,###.#;-#,###.#;0.0";
for certain conditions. I know this statement is executed because it passes the break point on this statement, but it does nothing on the display result.

My question is which Format should I change to overwrite the column format for this particular cell?

Thanks in advance.

1 Reply

HA haneefm Syncfusion Team June 21, 2007 03:03 PM UTC

Hi JP,

If you just want to format the text that is displayed in a cell, you can handle the TableControlDrawCellDisplayText and set e.DisplayText there to easily control what text is drawn in the cell.

Here is a forum thread that discuss with similar issue.
http://www.syncfusion.com/support/Forums/message.aspx?&MessageID=61549

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon