how would i bind a comma separated string such as: monday,tuesday to a list box control as these items being selected when the list box is already populated as such? sunday monday tuesday wednesday thursday friday saturday
I started with the following code:
string days = null;
List<string> lstdays = new List<string>();
//I get the values from a table such as:
foreach (DataRow dr in dt.Rows) {
//other items
days = dr(7).ToString();
}
if (days.Contains(",")) {
//days = Tuesday,Thursday
}
else
{
//days = Monday
lstbxDays.SelectedValue = days; //means there is a single day
}