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.
Syncfusion Feedback

displaying Boolean as yes or no

Thread ID:

Created:

Updated:

Platform:

Replies:

103255 Apr 17,2012 10:33 AM UTC May 20,2016 07:26 AM UTC ASP.NET Web Forms (Classic) 5
loading
Tags: GridGroupingControl
rcsatheeshkumar
Asked On April 17, 2012 10:33 AM UTC

I am using essential grid for MVC3.I am binding a datasource that has boolean as one property.The essential grid displays the Boolean property as checkbox.I need to display it as 'true' or 'false' like that...Could you help me with this?


Bala Murugan A.S [Syncfusion]
Replied On April 18, 2012 10:57 AM UTC

Hi Satheeshkumar,

Thanks for using Syncfusion Products.

We suggest you to use Format() method for the columns to display Boolean values(true or false) instead of check box. Please refer the below code snippet.

<%=Html.Syncfusion().Grid("SyncfusionGrid")
----
.Column(column => {
----
column.Add(P => P.Discontinued).HeaderText("Discontinued").Format("{0}");
})
-----
%>

For your convenience, we have prepared a simple sample to demonstrate this and the same can be downloaded from the below link.

Sample link: http://www.syncfusion.com/downloads/Support/DirectTrac/92329/Sample222748475.zip

Please try the above sample and let us know if you have any concerns.

Regards,
Bala Murugan A.S




rcsatheeshkumar
Replied On April 26, 2012 12:19 PM UTC

Hi Balamurugan,
Thanks for your timely reply.I tried your answer,but unfortunately it displays as 0 or 1 not yes/no.

Thank you in advance.


Bala Murugan A.S [Syncfusion]
Replied On May 7, 2012 05:50 AM UTC

Hi Satheesh Kumar,

Thanks for the update.

We are sorry for the delay in getting back to you. We are not able to reproduce your reported issue in our end. We have prepared a video of working sample and the same can be downloaded from the below link. Please have a look at the video.

Video:

http://www.syncfusion.com/downloads/Support/DirectTrac/93151/BooleanValue_JSON-950896707.zip

Please let us know if you have any concerns.

Regards,

Bala Murugan A.S


Nguyen Quy Danh
Replied On May 19, 2016 07:33 AM UTC

How can I display a Boolean property as checkbox?
I have a data source with boolean value and i want to ddissplay as a checkbox.


Kavitha Narayanan [Syncfusion]
Replied On May 20, 2016 07:26 AM UTC

Hi Nguyen, 
 
Query: I have a data source with Boolean value and I want to display as a checkbox. 
By default, Grid displays the Boolean property as checkbox. So, here it is not required to set Format () method for the column  
Please refer to the code and screenshot. 
 
 
.Column(column => 
                         { 
                             column.Add(p => p.ProductID).HeaderText("Order ID").Width(90).TextAlign(TextAlignment.Right); 
                             column.Add(p => p.ProductName).Width(100); 
                             column.Add(p => p.Discontinued).Width(90);//set boolean property to this column.                          
                         }) 
 
 
 
 
For your convenience, we have prepared a sample. 
 
 
We hope it helps to resolve your issue. 
 
Regards, 
Kavitha N. 
 
 
 
 


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.

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

;