2
Answers

C# CheckBoxList

Dane Marshall

Dane Marshall

13y
2k
1
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)