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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Changing cell value erases formatting

Thread ID:

Created:

Updated:

Platform:

Replies:

68890 Oct 4,2007 10:46 AM Oct 4,2007 11:43 AM Windows Forms 1
loading
Tags: GridControl
Adam
Asked On October 4, 2007 10:46 AM

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

haneefm [Syncfusion]
Replied On October 4, 2007 11:43 AM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;