Answered by:
how to sort collection and add values to CheckBoxList sorted

Question
-
HiI have this in the page for my CheckBoxList<table cellspacing="0" style="height: 100%;" width="100%" cellpadding="0"><tr ><td class="blueOnGreyText" width="100%" ><asp:CheckBoxList ID="chkLst" runat="server"RepeatDirection="Horizontal" RepeatColumns="3"></asp:CheckBoxList></td></tr></table>In My code i have a collection ReferenceCodeThis is what i use currently to add the values to the list.I need to
- Sort the data i get
- Add description and value to the list
ReferenceCode[] _col = _bllRefCodes.GetReferenceCodes("tested_drug_code_id")._collection;for (int i = 0; i <= _col.GetUpperBound(0); i++){chkLst.Items.Add(_col[i].Description);}Plz provide help on that--------------------------Tried this tooo but no sorting:BLLReferenceCode _bllRefCodes = new BLLReferenceCode();ReferenceCode[] _col = _bllRefCodes.GetReferenceCodes("tested_drug_code_id")._collection;for (int i = 0; i <= _col.GetUpperBound(0); i++){// Create new row and add it to the table.chkLst.Items.Add(new ListItem(_col[i].Description, _col[i].ReferenceCodeId.ToString()));}Tuesday, September 15, 2009 2:03 PM
Answers
-
Hello ,
Thank you for your post! I would suggest posting your question in the ASP forums located here: http://forums.asp.net
Have a great day!
Thanks!
SachinW Tier 2 Application Support Server and Tools Online Engineering Live Services TeamWednesday, September 16, 2009 12:08 PM
All replies
-
Hello ,
Thank you for your post! I would suggest posting your question in the ASP forums located here: http://forums.asp.net
Have a great day!
Thanks!
SachinW Tier 2 Application Support Server and Tools Online Engineering Live Services TeamWednesday, September 16, 2009 12:08 PM -
This is a C# .net question!!Wednesday, September 16, 2009 6:33 PM