Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. CheckboxList in FormView with multiple selections via Databinding - HOW??

CheckboxList in FormView with multiple selections via Databinding - HOW??

Scheduled Pinned Locked Moved ASP.NET
helpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jan Limpens
    wrote on last edited by
    #1

    Hi, I have got the following problem, maybe one of you guys already ran into it and knows the answer: I have a Formview bound to a ObjectDataSource for my class [Product]. It contains a Checkboxlist, bound to another ObjectDataSource which gets its Items from my class' [Category] SelectAll() method. Now every [Product] instance belongs to n categories (Product holds an IList with [Category] instances), and I need to bind them to the CheckboxList's Checked state. Unfortunately via DataBinding I can only access the SelectedValue (or SelectedIndex) field, which allows only for a single value and can select only one field. I cannot reach the CheckBoxList via code because evey control within a FormView seems to be completely out of reach. There aren't any visible instances (there is no protected CheckBoxList CheckBoxListCategories anywhere). So I am completely lost. I hope somebody can help me out of here :~ :sigh: -- Jan

    M 1 Reply Last reply
    0
    • J Jan Limpens

      Hi, I have got the following problem, maybe one of you guys already ran into it and knows the answer: I have a Formview bound to a ObjectDataSource for my class [Product]. It contains a Checkboxlist, bound to another ObjectDataSource which gets its Items from my class' [Category] SelectAll() method. Now every [Product] instance belongs to n categories (Product holds an IList with [Category] instances), and I need to bind them to the CheckboxList's Checked state. Unfortunately via DataBinding I can only access the SelectedValue (or SelectedIndex) field, which allows only for a single value and can select only one field. I cannot reach the CheckBoxList via code because evey control within a FormView seems to be completely out of reach. There aren't any visible instances (there is no protected CheckBoxList CheckBoxListCategories anywhere). So I am completely lost. I hope somebody can help me out of here :~ :sigh: -- Jan

      M Offline
      M Offline
      M LN Rao
      wrote on last edited by
      #2

      What you want to do exactly i did not got. If you want to access the checkboxgroup in the formview try CheckBoxList chkGroup = objFrm.FindControl("objChkGroup") as CheckBoxList ; and iterate through it. int index=0; for(index =0 ; index < chkGroup.Count ; index++) { } I hope this is your problem

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups