I have a page that contains a dropdownlistbox(autopostback=true) , a button and a radgrid. Depending on the selected index of the dropdownlistbox, when the user clicks on the button, I would like to bind the grid to the appropriate datasource. Since the columns displayed are different for each item selected in the dropdownlistbox, I am creating the grid programmatically in a function called "PopulateGrid". This function is being called in the page_preinit event as per the documentation.
However, I find that I have to click the button twice to retrieve the correct selected item in the dropdown to bind the grid to the correct dataset. This is because the grid is being bound in page preinit. The dropdownlistbox selected index changed event and button click event are fired after the page preinit. The 2nd time the button is clicked is when the correct selected index is retrieved.
Any workarounds to calling the PopulateGrid in the page_preinit event?
Thanks.
JK
However, I find that I have to click the button twice to retrieve the correct selected item in the dropdown to bind the grid to the correct dataset. This is because the grid is being bound in page preinit. The dropdownlistbox selected index changed event and button click event are fired after the page preinit. The 2nd time the button is clicked is when the correct selected index is retrieved.
Any workarounds to calling the PopulateGrid in the page_preinit event?
Thanks.
JK