Including a label,textbox and radiobuttonlist in a cell
-
i've a datalist. each cell should contain a label, textbox and radiobuttonlist. the reason why i choose a datalist is that the format should repeat in all cells which i thought can be achieved by repeating property of the datalist. the problem is assigning values to them and binding data to the controls. i've a dataset with question_no, question_desc in one table and second table has question_no,option_no and option_desc. now the data assignment would be like this: for question# 1, label.text=question_desc(corresponding to question#1) and radiobuttonlist's datasource is option_desc column filtered on question_no. this cannot be bind by usual .DataBind() method, i guess. please help me to assign the values for such multiple controls in a datalist from multiple tables of the dataset. regards, Pavan
-
i've a datalist. each cell should contain a label, textbox and radiobuttonlist. the reason why i choose a datalist is that the format should repeat in all cells which i thought can be achieved by repeating property of the datalist. the problem is assigning values to them and binding data to the controls. i've a dataset with question_no, question_desc in one table and second table has question_no,option_no and option_desc. now the data assignment would be like this: for question# 1, label.text=question_desc(corresponding to question#1) and radiobuttonlist's datasource is option_desc column filtered on question_no. this cannot be bind by usual .DataBind() method, i guess. please help me to assign the values for such multiple controls in a datalist from multiple tables of the dataset. regards, Pavan
May be not the best choice, but what I'd do is... In the ItemDataBound event of the Datalist, you can check th question_no column of every row, make a query to the database for the options, and bind the results to the radiobuttonlist. Another option could be... have all the questions / options in datatables in a dataset, and again in the ItemDataBound event of each item in the DataList, make a DataView of the options of the specific question, and bind them to the RadioButtonList. I hope this makes sense. daniero