We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to display Yes/No for boolean fields

Thread ID:

Created:

Updated:

Platform:

Replies:

97110 Oct 28,2010 09:28 AM Nov 1,2010 02:49 AM Windows Forms 1
loading
Tags: GridControl
Vitaliy Kryvosheiev
Asked On October 28, 2010 09:28 AM

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.


Jisha Joy [Syncfusion]
Replied On November 1, 2010 02:49 AM

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



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;