string ctypes = Convert.ToString(dtPtsDetail.Rows[0]["Type1"]);
string\[\] arr = ctypes.Split(',');
for (int c = 0; c < arr.Length - 1; c++)
{
ddlType.Items.Add(arr\[c\]);
}
foreach (string ar in arr)
{
foreach (ListItem itc in ddlType.Items)
{
if (ar == itc.Value)
itc.Selected = true;
else
continue;
}
}
string ctypes = Convert.ToString(dtPtsDetail.Rows[0]["Type1"]);
string\[\] arr = ctypes.Split(',');
ddlType.SelectedIndex = ddlType.Items.IndexOf(ddlType.Items.FindByValue(arr\[0\]));
手机扫一扫
移动阅读更方便
你可能感兴趣的文章