This is a migrated thread and some comments may be shown as answers.

RadGrid on User control Refresh in RadWindow

2 Answers 99 Views
Window
This is a migrated thread and some comments may be shown as answers.
newguy
Top achievements
Rank 1
newguy asked on 03 Jul 2013, 11:39 AM
Hi guys,

This is a 2 part question, i have been through some of the examples and previous questions posted and havent found my answer.

1st.
I have a main.aspx page with a RadGrid , In the Grid i have a column with and ImageButton that Opens Edit.aspx page inside of a RadWindow. On the Edit.aspx page i have 7 UserControls that are only shown when needed, The one user control is just a summary Control and has a RadGrid on it (This is the default UserControl that Gets shown when the RadWindow is opened). Now when a different UserControl is shown the Summary UserControl Just gets hidden.

On the UserControl now being shown it has a few Text Boxes and a Save Button which will update my database. When the user Clicks on the Save button my database is updated, the Current UserControl is hidden and my summary UserControl is being shown again. The problem i am having is that the RadGrid in the Summary UserControl Isnt being refreshed or updated. The only way i have found the RadGrid to refresh its contents it to close the RadWindow and open it again by clicking on my imageButton on the Main.aspx page.

Is there a way to refresh the RadGrid on the Summary UserControl once a user clicks on the Save button and the Summary UserControl is being shown again. (All code snippets i have found so far have failed)

RadWindow on the Main.aspx page

<telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="True">
<Windows>
<telerik:RadWindow ID="IncidentListDialog" runat="server" Title="Incident" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true" Width="900px" Height="760px" Left="50px" Top="50px" >
</telerik:RadWindow>
 
<telerik:RadWindow ID="IncidentActionsDialog" runat="server" Title="Actions" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true" Width="900px" Height="760px" Left="50px" Top="50px">
</telerik:RadWindow>
</Windows>
</telerik:RadWindowManager>


2nd
On my Main.aspx page, When i Click on the ImageButton to open a New RadWinow even though i have set Top and Left positions my RadWindow Still Centers itself on my screen, and if i am scrolled to the top of the Main.aspx page and Click on a ImageButton the Radwindow will move to the Top of my page where i cannot access the RadWindows Control bar

2 Answers, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 04 Jul 2013, 01:46 PM
Hi,

On refreshing the grid - all this functionality is encapsulated in the page loaded in the RadWindow. This means if it works outside of the RadWindow, it will work inside as well. The most likely reason I find for this behavior is AJAX - if you do not update all the necessary controls you will not see an update in the grid's datasource. What I can suggest at this point is making sure it is included in the response and making sure its Rebind() method is called. You can expose the grid in a public property of its user control so you can access it from the other user control.

On the RadWindow position - a modal RadWindow is always centered and the following article explains how to change that: http://www.telerik.com/help/aspnet-ajax/window-troubleshooting-positioning-modal-popup.html.
The positioning issue is most likely related to default focus in the content page that causes the browser to attempt to scroll it into view, see this thread on the matter: http://www.telerik.com/community/forums/aspnet-ajax/window/radwindow-moves-by-itself-after-opening.aspx.


Regards,
Marin Bratanov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
newguy
Top achievements
Rank 1
answered on 05 Jul 2013, 11:59 AM
Thank you marin you such a legend.

I will post my code soon so other user can see what was done.
Tags
Window
Asked by
newguy
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
newguy
Top achievements
Rank 1
Share this question
or