G
Guest
Hi. I'm trying to come up with a customized RadioButtonList and I don't know where to start.
My requirements are: I'll be given a dataset that contains one table with product data (eg price, product_name, product_description, product_id) and I have to build a control that displays the products dataset on a page, allowing the user to make only one product selection at a time.
That's not too bad, and I know I can do it with a RadioButtonList, but, the control has to be customized. If I want to display only products that match a specific criteria, I should be able to do that. For this I was thinking to write a CustomizedRadioButtonList class that would override the DataBind function, define a dataview with the specified criteria and databind to this dataview.
That is also ok, but here comes the hard part: Some products could be purchased together if they have the same bundle_id in the dataset; for this, the first product with bundle_id=5 (for example) would be displayed as a radio button and all the other products with bundle_id=5 would be displayed as checkboxes underneath it.
e.g:
O product 1 (bundle_id=3)
[] product 2 (bundle_id=3)
O product 3 (bundle_id=55)
[]product 4 (bundle_id=55)
[]product 5 (bundle_id=55)
etc
The page also contains a submit button; when the user clicks it, I should be able to capture the selected product, and the selected bundle products.
Is there an easy way to do this with the server controls provided by ASP.NET?
I just don't have enough experience to tell if it can be done or not.
Where would I begin?
Are there any examples like this on the net?
Thanks in advance.
BITM
My requirements are: I'll be given a dataset that contains one table with product data (eg price, product_name, product_description, product_id) and I have to build a control that displays the products dataset on a page, allowing the user to make only one product selection at a time.
That's not too bad, and I know I can do it with a RadioButtonList, but, the control has to be customized. If I want to display only products that match a specific criteria, I should be able to do that. For this I was thinking to write a CustomizedRadioButtonList class that would override the DataBind function, define a dataview with the specified criteria and databind to this dataview.
That is also ok, but here comes the hard part: Some products could be purchased together if they have the same bundle_id in the dataset; for this, the first product with bundle_id=5 (for example) would be displayed as a radio button and all the other products with bundle_id=5 would be displayed as checkboxes underneath it.
e.g:
O product 1 (bundle_id=3)
[] product 2 (bundle_id=3)
O product 3 (bundle_id=55)
[]product 4 (bundle_id=55)
[]product 5 (bundle_id=55)
etc
The page also contains a submit button; when the user clicks it, I should be able to capture the selected product, and the selected bundle products.
Is there an easy way to do this with the server controls provided by ASP.NET?
I just don't have enough experience to tell if it can be done or not.
Where would I begin?
Are there any examples like this on the net?
Thanks in advance.
BITM