Changing cell value erases formatting

hi,

I try to programatically change the value of a cell, but after I do so the new cell value is not formatted as per the format property.

Initially, I set gridstyleinfo format, and gridstyleinfo cell value which gets formatted appropriately. But then on button click, I change gridstylinfo cellvalue, but the new value is not formatted. I have attached a sample.

Thanks for your help.

Syncfusion.zip

1 Reply

HA haneefm Syncfusion Team October 4, 2007 03:43 PM UTC

Hi Adam,

You can try setting the CellValueType property to "System.Double" andalso call the ApplyFormattedText method in a button.Click event to apply the format of the gridcell. Below are the codes that shows this task.

'LoadGrid method
gsi.CellValueType = Type.GetType("System.Double")

'Buttton.click event handlerCode
Grid.Model.Item(1, 1).CellValue = "9998.5369"
Grid.Model.Item(1, 1).ApplyFormattedText(Grid.Model.Item(1, 1).Text)
Grid.Model.Refresh()

Best regards,
Haneef

Loader.
Up arrow icon