Hi,
I want to display a boolean column as a Yes/No string. I set the CellDisplayType to FormattedText and tried many formats: {0:Yes;No}, Yes,No, Yes/No. I read in the online docs that "The underlying .NET formatting mechanism is used to format the value. See .NET help for more information regarding list of the named formats that are supported." So the first format should work but I just get True/False in the cell.
Thanks.
The article Vince is referring to here is for displaying a checkbox and storing a string, which if I understand you correctly, is exactly the opposite of what you want. You want to store a boolean, but display a string.
FormattedText doesn't refer to formatting the value of a cell, it refers to a custom XML format which you can use to display colors and fonts similar to RichText.
The Format property of the column won't help you here, because the Boolean data type in DotNet doesn't accept any formats to it's ToString method.
But there are any number of ways you can acheive what you want.
Thanks. A value list would be the simplest option. Any idea about the performance differences between the different methods?
I agree that the ValueList is the simplest option. It also provides a nice UI for the user to change the value of the cell - assuming you want it to be editable.
Regarding performance, it probably doesn't make much difference. If I had to speculate, I'd expect the DrawFilter (or a CreationFilter) would probably be the most efficient and the other three methods are all about the same.But the difference in performance is probably pretty trivial.
The down side of the Draw/CreationFilter is that it would not allow the user to edit the cell - at least not without some additional coding.