Dane Marshall

Dane Marshall

  • NA
  • 6
  • 3.9k

C# CheckBoxList

Oct 11 2011 4:06 AM
Hi,

When creating a dynamic checkboxlist, I am able to add items to the checkbox list by doing SecCB.Items.Add(sec.Sector_Name); but how do I add an ID or Value to the item?

Thanks

  public void DeveloperSectors()
  {
   DCDataContext dc = new DCDataContext();

   SecCB.RepeatColumns = 3;
   SecCB.RepeatDirection = RepeatDirection.Horizontal;

   IQueryable<DeveloperSector> DevSecRe = from se in dc.DeveloperSectors orderby se.Sector_Order ascending select se;

   foreach (DeveloperSector sec in DevSecRe)
   {
    SecCB.Items.Add(sec.Sector_Name);
   }
  }


Answers (2)