Hi Rex,
You need to cycle through each record and set the Selected property.
cbList.DataTextField="ProductName";
cbList.DataValueField="Discontinued"; // boolean database column
cbList.DataBind();
foreach (ListItem li in cbList.Items) {
li.Selected = bool.Parse(li.Value); // will check/uncheck, depending on "Discontinued" value
}
>All,
>
>Is there a property on the CBL that handles this with the DataBind() or do I need to cycle through all the checkboxes and set the Selected property?
>
>In my example I have the DataSource, DataTextField and DataValueField properties set, but the checkboxes are not showing checked.
>
>TIA
>
>Rex
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi