When I set the cell's Style to URL, I'm losing the decimal format. It is trimming trailing zeroes. And it seems to ignore the cell's Format property. How do you change a decimal cell or column to display as a link while keeping the current formatting intact?
Hi,
Using a URL Style for the column means that the column's data will be interpreted as a string, and there's no way to format a string - or at least no automatic or easy way.
One thing you could do is hide the real column of decimal data. Keep the Format on it, but set Hidden to True on that column. Then you could add an unbound string column to the grid in it's place and set the Style of this column to URL. Then you use the InitializeRow event to copy the Text of the real, hidden, decimal cell into the URL cell.
That seems to work fine; however, it's removing the comma in the final URL string. Is there a way to prevent this?
I tested this out and it's working fine for me. As long as the text of the cell contains a comma, it shows up correctly in the URL. So either the string you are assigning the cell doesn't have a comma in it, or else maybe this is a bug in some older version of the controls you are using.
What version are you using? Do you have the latest SR?
How to get the latest service release - Infragistics Community
Try putting a breakpoint in the InitializeRow event and look at the actual text you are assigning to the URL cell. If it includes a comma and that comma is not displaying on the screen, then my best guess is that comma's simply aren't allowed in URLs. Or... maybe you have to use an escape code.
I think so. The value being assigned is formatted using System.String.Format(<boundCellValue>, {0:-###,###,##0.0000}).
Um... I can't think of any reason why a comma would be removed. Are you sure the comma is in the text you are setting to the unbound cell?