CheckboxList in FormView with multiple selections via Databinding - HOW??
-
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
-
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
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