How to display Yes/No for boolean fields

Hi!

How to configure GGC/WinForms to display Yes/No instead of CheckBox for boolean fields.

foreach(var column in ggc.TableDescriptor.Columns) {
if (column.Appearance.AnyRecordCell.CellType == "CheckBox")
column.Appearance.AnyRecordCell.CellType = "TextBox";
}

not working for me.

SyncFusion 7.4

Thanks.


1 Reply

JJ Jisha Joy Syncfusion Team November 1, 2010 06:49 AM UTC

Hi,

You could achieve the desired behavior by handling the QueryCellFormattedText event.

private void gridControl1_QueryCellFormattedText(object sender, GridCellTextEventArgs e)

{

if(e.Style.CellValueType == typeof(bool) && e.Style.CellType == "TextBox")

{

if(e.Value.ToString() == "True")

e.Text = "Yes";


else

e.Text = "No";

e.Handled = true;


}}


Regards,
Jisha



Loader.
Up arrow icon