hi
in my webpage have two checkboxlist1 and checkboxlist 2
in checkboxlist1 i click one item then item is remove from checkboxlist and add into checkboxlist2
now again i click in checkboxlist2 the item delete from 2 and add into 1 chekboxlist but
item add in last and not short
how to short the checkbox list after add any item
please help me......
Loading

Manikavelu VelayuthamPosted Oct 28, 2010, 7:40 AM
Dharmesh SharmaPosted Oct 28, 2010, 7:23 AM
Use the using System.Collections namespaces
and add checkbox to Sortedlist class and bind to the checkboxlist;
here is code
SortedList sortedlist = new SortedList();
for (int i1 = 0; i1 < chk_1.Items.Count; i1++)
{
sortedlist.Add(chk_1.Items[i1].Value, chk_1.Items[i1].Text);
}
chk_1.DataSource = sortedlist;
chk_1.DataTextField = "Value";
chk_1.DataValueField = "Key";
chk_1.DataBind();
Thanks Dharmesh
hai hai hia hai