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......
Short checkboxlist
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Dharmesh SharmaRank #1,974 · 741 reputationPosted Oct 28, 2010, 3:23 AM EDT
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
Manikavelu VelayuthamRank #413 · 6K reputationPosted Oct 28, 2010, 3:40 AM EDT