This is a migrated thread and some comments may be shown as answers.

Data bind checkbox status?

1 Answer 48 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 2
Dan asked on 11 Nov 2011, 06:45 PM
Is there any way to bind the checked/unchecked status of the listbox checkboxes from the datasource?
Thanks.
Dan

1 Answer, 1 is accepted

Sort by
0
Dan
Top achievements
Rank 2
answered on 11 Nov 2011, 09:47 PM
I found the answer to this in the documentation, via using the OnItemDataBound event:
protected void RadListBox1_ItemDataBound(object sender, RadListBoxItemEventArgs e)
{
     System.Data.Common.DbDataRecord dataSourceRow = (System.Data.Common.DbDataRecord)e.Item.DataItem;
     e.Item.Checked = (bool)dataSourceRow["account_status_access"];
}
Tags
ListBox
Asked by
Dan
Top achievements
Rank 2
Answers by
Dan
Top achievements
Rank 2
Share this question
or