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

Howto: format text in currentcell through PrepareViewStyleInfo event

How can i format the text in the current cell through the PrepareViewStyleInfo event? The problem was probably done by design since one may need to edit the contents of a cell and not their formatted view; The problem i have is 1. datatable has a column of phonenumbers which are just strings with the numeric portion of the numbers 2. dataview bound to the grid needs to be able to filter the numbers (portions and whole) 3. grid is readonly for selection only 4. if the current cell is in the phone number column the text inside is is unformatted currently im using e.Style.Text = formattedNumber; how can i workaround this feature?

1 Reply

AD Administrator Syncfusion Team December 12, 2003 10:55 PM UTC

You can use CurrentCellInitializeControlText to strip out the extra characters from the text you want to see when the cell starts to edit. You can then use SaveCellFormatted to put these characters back in. Here is a little sample. You could also use a MaskEdit cell for your phone numbers.

Live Chat Icon For mobile
Up arrow icon