Hi all,
First of I'm not sure this is the right place for my question, but I could't find a more appropriate.
On a web page I have have sidebar and main content area. In the main content is a RadGrid with a collections of products of a selected product category. In the sidebar I have User control where the user can filter the product in the grid. This QuickFilter user control have a RadPanelBar and in every panel is a CheckBoxList. This UI of the was requirement from the client.
The RadPanelBar Items and the CheckBVoxLists are created dynamic because that the number of filter categories (panels in the RadPanelBar) and the number of filter options (check boxes in the CheckBoxList) are different from one product category to another.
In the Page_Inet of the user control I create the RadPanelItems and the CheckBoxLists, so that they an there values are been persisted in the ViewState. In OnClick event of a button I read out the selected check boxes and query the database for the RaGrid and do a Rebind op the grid.
This works as expected.
But now build in a "Brand" selector. I's simple two RadioButtons sitting in the sidebar. In the SelectedIndexChange I have to build the Filter User Control again because that the filter categories and filter options are different between the two Brands.
But because the SelectedIndexChange fires after the Page_Init the new build RadPanelBar items en check boxes are not added to the ViewState. and therefor the selected values aren't persisted.
I have tried to build the RadPanelBar items en check boxes again on the SelectedIndexChange but this seems to work.
I would like just to refresch the Filter User Control in the SelectedIndexChange so that the Page_Init was fired again. Is this possible/ Or can I add the dynamic created controls and the value to the ViewState?
Or is there another solution?
Anders Pedersen
First of I'm not sure this is the right place for my question, but I could't find a more appropriate.
On a web page I have have sidebar and main content area. In the main content is a RadGrid with a collections of products of a selected product category. In the sidebar I have User control where the user can filter the product in the grid. This QuickFilter user control have a RadPanelBar and in every panel is a CheckBoxList. This UI of the was requirement from the client.
The RadPanelBar Items and the CheckBVoxLists are created dynamic because that the number of filter categories (panels in the RadPanelBar) and the number of filter options (check boxes in the CheckBoxList) are different from one product category to another.
In the Page_Inet of the user control I create the RadPanelItems and the CheckBoxLists, so that they an there values are been persisted in the ViewState. In OnClick event of a button I read out the selected check boxes and query the database for the RaGrid and do a Rebind op the grid.
This works as expected.
But now build in a "Brand" selector. I's simple two RadioButtons sitting in the sidebar. In the SelectedIndexChange I have to build the Filter User Control again because that the filter categories and filter options are different between the two Brands.
But because the SelectedIndexChange fires after the Page_Init the new build RadPanelBar items en check boxes are not added to the ViewState. and therefor the selected values aren't persisted.
I have tried to build the RadPanelBar items en check boxes again on the SelectedIndexChange but this seems to work.
I would like just to refresch the Filter User Control in the SelectedIndexChange so that the Page_Init was fired again. Is this possible/ Or can I add the dynamic created controls and the value to the ViewState?
Or is there another solution?
Anders Pedersen