RadComboBox accesslists = new RadComboBox();
accesslists.Attributes.Add("runat", "server");
accesslists.Attributes.Add("EnableCheckAllItemsCheckBox", "true");
accesslists.Attributes.Add("EmptyMessage", "Select");
accesslists.CheckBoxes = true;
accesslists.MaxHeight = 200;
accesslists.Width = 400;
accesslists.AutoPostBack = true;
accesslists.Style["margin-left"] = "5.6%";
By adding this RadCombobox control and
datasource assign to radcombobox
con.Open();
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter("SELECT Brand.BrandName FROM Brand INNER JOIN ProductBrand ON Brand.Brand_ID = ProductBrand.Brand_ID INNER JOIN Product ON ProductBrand.Product_ID = Product.Product_ID WHERE (Product.Product_ID = 1) ORDER BY Brand.BrandName", con);
da.Fill(dt);
accesslists.DataSource = dt;
accesslists.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(accesslists_SelectedIndexChanged);
foreach (DataRow row in dt.Rows)
{
RadComboBoxItem item = new RadComboBoxItem();
item.Text = row["BrandName"].ToString();
item.Value = row["BrandName"].ToString();
item.Attributes.Add("BrandName", row["BrandName"].ToString());
accesslists.Items.Add(item);
item.DataBind();
}
con.Close();
By this way we create dropdownlist of multiple selection checkboxes