Pergunta

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?

Foi útil?

Solução

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;
}
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top