Rather than using a panel control to hold your collection of Checkboxes you can use a CheckboxList. It allows you to easily create a list of checkboxes from any datasource and you can easily retrive the selected items.
You can directly bind your data source to the Checkboxlist and control the display orientation using properties.
chkList.DataSource=dt;
chkList.DataBind()
The below code illustrates how to fetch the values -
ArrayList SelectedItems
foreach ListItem item in chkList.Items
{
if (item.Selected)
{
SelectedItems.Add(item.Text);
}
}
HTH!
Dinesh
Mark as solution if this worked!