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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to display Yes/No for boolean fields

Thread ID:

Created:

Updated:

Platform:

Replies:

97110 Oct 28,2010 01:28 PM UTC Nov 1,2010 06:49 AM UTC WinForms 1
loading
Tags: GridControl
Vitaliy Kryvosheiev
Asked On October 28, 2010 01:28 PM UTC

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 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



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

;