ive got a demo (winForms) i did showing how to bind data to various
properties of controls (standard text, images and even the font color
property... )
was thinkin abt uploading it to planetsourcecode.com (just need to comment
the code nicely)
but what u need is to just bind the checkboxs selected property.
Scenario 1
If you already have the dataset on the designer u link it via the property
box.
1. Select the checkbox, browse the DataBinding property and link it to
the desired
DataSet.DataTable.Field
Scenario 2
If you are doing it thru code , then u need to write the databinding code
via.
CheckBox1.DataBindings.Add("Checked", Ds1,"Employees.Status")
where "Checked" is the property, DS1 is the datasource (dataset name) and
the Employees.Status is the datafield to be bound to (employees datatable
and Status field)
Note: I used a bit datatype for my Status field to be linked to the Checked
propery of the checkBox.
The above code is for winForms....
In asp.Net the equivalent would be the same for both Scenario 1 and 2 just
make sure DS1 is available prior to page load (page level declaration would
work):
<asp:CheckBox id="CheckBox1" runat="server" Checked='<%#
DataBinder.Eval(Ds1, "Tables[Employees].DefaultView.[0].Status") %>'>
</asp:CheckBox>
HTH..
Mike...
http://bikesh.europe.webmatrixhosting.net
http://www.planetsourcecode.com (search keyword : phoetus)