hello,
in my application i have the following scenario:
From a simple ASP.NET page with a few ASP.NET-controls like DropDownList an RadioButton, the user can select a UserControl with an build-in RadGrid. The user first enters some Information and select some values in the ASP.NET page, then he presses a button to load the control based on the selected values (other values loads the same control with different data in the build-in RadGrid).
The Control ist loaded with the LoadControl() from Class Page, whenever the user presses the button.
The Control has a Page_Load with the following code:
The RadGrid´s DataSource is updated on every click in the ASP.NET-Page.
In addition, the NeedDataSource Method is implemented:
The following error occurs:
When the user presses the button the first time the control and the RadGrid are loaded correctly. Then, if the user chance the values in the ASP.NET-page and presses the button again the "old" build-in RadGrid is still there!
In debug-mode i figured out that the NeedDataSource is not called, after the control was loaded again.
I try to set the DataSource in the PageLoad on every PostBack, and it works! The new build-in RadGrid was loaded. But then there is an another problem: if the user presses the hide-button, after he has expanded a hierachy nothing happens.
How is it possible to bring these two things (load the RadGrid correctly and hide a hierachy) together?
Thanks for help!
in my application i have the following scenario:
From a simple ASP.NET page with a few ASP.NET-controls like DropDownList an RadioButton, the user can select a UserControl with an build-in RadGrid. The user first enters some Information and select some values in the ASP.NET page, then he presses a button to load the control based on the selected values (other values loads the same control with different data in the build-in RadGrid).
The Control ist loaded with the LoadControl() from Class Page, whenever the user presses the button.
The Control has a Page_Load with the following code:
| if(!IsPostBack) |
| { |
| RadGrid.DataSource = my_dataSource; |
| RadGrid.DataBind() |
| } |
The RadGrid´s DataSource is updated on every click in the ASP.NET-Page.
In addition, the NeedDataSource Method is implemented:
| protected void RadGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e) |
| { |
| RadGrid.DataSource = my_dataSource; |
| } |
The following error occurs:
When the user presses the button the first time the control and the RadGrid are loaded correctly. Then, if the user chance the values in the ASP.NET-page and presses the button again the "old" build-in RadGrid is still there!
In debug-mode i figured out that the NeedDataSource is not called, after the control was loaded again.
I try to set the DataSource in the PageLoad on every PostBack, and it works! The new build-in RadGrid was loaded. But then there is an another problem: if the user presses the hide-button, after he has expanded a hierachy nothing happens.
How is it possible to bring these two things (load the RadGrid correctly and hide a hierachy) together?
Thanks for help!