Domanda

I have an Infragistics UltraWinGrid bound to a data source, and one of the columns in that data source contains boolean values. I have the Style property for the column set to Edit so that it will display text instead of a checkbox. However, instead of displaying the values True or False, I want it to display Yes or No.

How do I format the value of the cell to display Yes or No for a boolean value?

È stato utile?

Soluzione

You could define a ValueList and set the ValueList property of the column

private void ultraGrid1_InitializeLayout(object sender, InitializeLayoutEventArgs e)
{
    ValueList vl=new ValueList();
    vl.ValueListItems.Add(true, "Yes");
    vl.ValueListItems.Add(false, "No");
    e.Layout.Bands[0].Columns["ColumnBoolean"].ValueList=vl;
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top