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

checkbox in grid does not display correctly

Thread ID:





74988 Jul 7,2008 08:59 PM UTC Sep 25,2008 07:40 PM UTC ASP.NET Web Forms (Classic) 3
Tags: GridGroupingControl
Mike Bourne
Asked On July 7, 2008 08:59 PM UTC

I have a datasource that contains 3 columns. 2 of the 3 columns are text data and the 3rd is a "Bit" field that is either true or false.

I have a blank aspx (vb.net) page that I dragged a grid control onto, Set the datasource based on my sqldatasource parameters. I added a checkbox control in the 3rd column using the "Edit Template" functionality.

The text data displays correctly, but all of the check boxes display in an unchecked mode when some should display as checked.

What am I doing wrong?

Thanks in advance,

Mike B.

Rajarajeswari S [Syncfusion]
Replied On July 8, 2008 07:30 AM UTC

Hi Mike,

Thanks for using Syncfusion products:

EditItemTemplate controls simply render the control on the column while editing. To make the checkbox to reflect he column values, we have to manually binded the checkbox with the column. Please refer the below code snippet which illustrates this:

$sfwg:GridColumnDescriptor MappingName="Checkbox">
$asp:CheckBox id="cbTemplate" runat="server" Checked="" AutoPostBack="true">

Here "$" is used instead of "<"

protected bool GetValue(GridCell container)
int val;
Record rowRecord = container.Row.Record;
val = Convert.ToInt32(rowRecord.GetValue("Checkbox"));
if (val == 0)
return false;
return true;

The GetValue method returns Boolean value depending upon the column values.

Please refer the sample from the below link, which illustrates the above:


Please let me know if you have any other concerns.


Administrator [Syncfusion]
Replied On September 23, 2008 04:58 PM UTC

I seem to be having problems getting check box to work in Item Template. I have the following within Item Template of a GridColumnDescriptor

asp:CheckBox ID="chkCalculation" runat="server" Checked="<%# GetBoolField(Container) %>"

GetBoolField method returns bool value based on the value in the database. However, GetBoolField method never gets called.

Rajarajeswari S [Syncfusion]
Replied On September 25, 2008 07:40 PM UTC

Hi Raj,

Thanks for using Syncfusion products.

Please refer the modified sample from the below link:


Here CheckBox is used as ItemTemplates and are binded with values from DataSource using the GetValue method which returns bool value. Accroding to this the CheckBox checked value get differed.

Please have a look at the above and let us know if this helps you out.



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

or the page will be automatically redirected to 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