Link to home
Start Free TrialLog in
Avatar of KavyaVS
KavyaVS

asked on

How to bind the check box in Grid View.How to show it as Checked or Unchecked

Hi,
I have a bit field in the SQL Table.I am binding that field to check box control in Grid View.
If the SQL Table value equal to 1 I want to show the Check Box checked,otherwise
I want to unchecked it.

Now after binding the Data Table to Grid View it is showing True or False besides Check Box.Check Box is Just empty.I don't want to show any Text besides check box.Just want to show it as checked or unchecked.

Any suggestions please.

Thanks

Thanks
SOLUTION
Avatar of Pratima
Pratima
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of KavyaVS
KavyaVS

ASKER

Thanks it's working.
Can I add the check box column to Grid View in the code behind.Now I am adding the ButtonField and Bound Columns from the code behine.
This is the button field.
ButtonField btn = new ButtonField();
            btn.ButtonType = ButtonType.Link;
            btn.DataTextField = "Date";
            btn.SortExpression = "Date";
            btn.ShowHeader = true;
            btn.HeaderText = "Date";
            grd1.Columns.Add(btn);

Thanks.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of KavyaVS

ASKER

Thanks