Hi ganesh.gholap...,
Use below code.
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
var listBox = new Saplin.Controls.DropDownCheckBoxes
{
ID = "DropDownCheckBoxes1",
UseSelectAllNode = false
};
ListItem item1 = new ListItem();
item1.Text = "XYZ";
item1.Value = "0";
listBox.Items.Add(item1);
ListItem item2 = new ListItem();
item2.Text = "Testing XYZ";
item2.Value = "1";
listBox.Items.Add(item2);
ListItem item3 = new ListItem();
item3.Text = "Testing XYZ1";
item3.Value = "2";
listBox.Items.Add(item3);
ListItem item4 = new ListItem();
item4.Text = "Testing XYZ2";
item4.Value = "3";
listBox.Items.Add(item4);
ListItem item5 = new ListItem();
item5.Text = "Testing XYZ4";
item5.Value = "4";
listBox.Items.Add(item5);
ListItem item6 = new ListItem();
item6.Text = "Testing XYZ5";
item6.Value = "5";
listBox.Items.Add(item6);
ListItem item7 = new ListItem();
item7.Text = "Testing XYZ6";
item7.Value = "6";
listBox.Items.Add(item7);
form1.Controls.Add(listBox);
}
}
It will be rendered in the page as below when you do inspect.
<div class="dd_chk_select" id="DropDownCheckBoxes1_sl" style="display: inline-block; position: relative;">
<div id="caption">
Select
</div>
<div class="dd_chk_drop" id="DropDownCheckBoxes1_dv" style="display: block; position: absolute;">
<div id="checks">
<span id="DropDownCheckBoxes1">
<input name="DropDownCheckBoxes1$0" id="DropDownCheckBoxes1_0" type="checkbox" value="0"><label for="DropDownCheckBoxes1_0">XYZ</label><br>
<input name="DropDownCheckBoxes1$1" id="DropDownCheckBoxes1_1" type="checkbox" value="1"><label for="DropDownCheckBoxes1_1">Testing XYZ</label><br>
<input name="DropDownCheckBoxes1$2" id="DropDownCheckBoxes1_2" type="checkbox" value="2"><label for="DropDownCheckBoxes1_2">Testing XYZ1</label><br>
<input name="DropDownCheckBoxes1$3" id="DropDownCheckBoxes1_3" type="checkbox" value="3"><label for="DropDownCheckBoxes1_3">Testing XYZ2</label><br>
<input name="DropDownCheckBoxes1$4" id="DropDownCheckBoxes1_4" type="checkbox" value="4"><label for="DropDownCheckBoxes1_4">Testing XYZ4</label><br>
<input name="DropDownCheckBoxes1$5" id="DropDownCheckBoxes1_5" type="checkbox" value="5"><label for="DropDownCheckBoxes1_5">Testing XYZ5</label><br>
<input name="DropDownCheckBoxes1$6" id="DropDownCheckBoxes1_6" type="checkbox" value="6"><label for="DropDownCheckBoxes1_6">Testing XYZ6</label></span>
</div>
</div>
</div>