Resizing RadGridView causes data to be reloaded

6 posts, 0 answers
  1. IsolatedStorage
    IsolatedStorage avatar
    15 posts
    Member since:
    Sep 2009

    Posted 17 Mar 2011 Link to this post

    Please can you let me know what might cause a UserControl hosting a RadGridView to reload the data when the hosting ASP.NET page is resized? All the columns in the RadGridView are a fixed size apart from one which fills the rest of the grid. I have EnableColumnVirtualization="True"  and EnableRowVirtualization="True".

    Thanks in advance
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 18 Mar 2011 Link to this post

    Hello IsolatedStorage,

     Can you post more info how the grid is bound in your case? Are you using our virtual collection

    All the best,
    Vlad
    the Telerik team
  3. DevCraft banner
  4. IsolatedStorage
    IsolatedStorage avatar
    15 posts
    Member since:
    Sep 2009

    Posted 20 Mar 2011 Link to this post

    Hi Vlad,

    below is an outline of my XAML control tree:

    <UserControl x:Class="... DataContext="{Binding Source={StaticResource Locator}, Path=AttendanceViewModel,Mode=TwoWay}">
     
        <telerik:RadBusyIndicator x:Name="BusyIndicator" ... >
     
            <telerik:RadTabControl Grid.Row="0" ItemsSource="{Binding AttendanceSheets, Mode=TwoWay}" >
     
                <telerik:RadTabControl.ContentTemplate>
                      <DataTemplate>
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*" />
                                </Grid.RowDefinitions>
     
                                 <telerik:RadGridView Grid.Row="0" x:Name="AttendanceRadGrid" AutoGenerateColumns="False" DataLoadMode="Asynchronous" IsFilteringAllowed="False" ShowGroupPanel="False" ItemsSource="{Binding Attendances, Mode=TwoWay}" MinWidth="850" Margin="2,0,2,2" ShowColumnFooters="True" ShowGroupFooters="True" RowStyleSelector="{StaticResource rowStyles}" EnableColumnVirtualization="True" EnableRowVirtualization="True" Style="{StaticResource BaseGridViewStyle}" ValidatesOnDataErrors="InViewMode">
     
                                      <telerik:RadGridView.Columns>
                                                 ...
                                       </telerik:RadGridView.Columns>
     
                                </telerik:RadGridView>
                            </Grid>
                        </DataTemplate>
                     </telerik:RadTabControl.ContentTemplate>
                 </telerik:RadTabControl>
            </telerik:RadTabControl>
     
        </telerik:RadBusyIndicator>
     
     
    </UserControl>

    Basically, the grid is displayed within a TabControl. The TabItems are defined by the contents of an ObservableCollection (AttendanceSheets). Each TabItem hosts a grid which contains another ObservableCollection (Attendances). Each column in the grid is bound to the relevant property in the Attendances class. The Silverlight control sits inside an ASP.NET host page (a Telerik RadWindow) and is set to 100% height and width so it re-sizes when the RadWindow is re-sized.

    Let me know if you need any more information.

    Thank you
  5. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 21 Mar 2011 Link to this post

    Hello IsolatedStorage,

     Can you clarify what is hidden behind ItemsSource="{Binding Attendances, Mode=TwoWay}" and how do you know that data are reloaded? Can you try to bind simple ListBox instead to see if you will have different behavior?

    Best wishes,
    Vlad
    the Telerik team
  6. IsolatedStorage
    IsolatedStorage avatar
    15 posts
    Member since:
    Sep 2009

    Posted 21 Mar 2011 Link to this post

    Hi Vlad,

    the ItemsSource contains QueryableCollection<T> where T is the Attendances. This is simply a list of student IDs, names and other details which are displayed in the grid. Once the grid has been loaded, I can make changes to some of the data in the grid but when I resize the hosting RadWindow before saving the changes, to display more rows for example, the grid data is reset to the original values. Plus, the RadBusyIndicator is displayed as per the initial data loading mechanism.

    I haven't tried binding to a simple listbox. If I get an opportunity I will try and put together a sample project to recreate the issue.
  7. IsolatedStorage
    IsolatedStorage avatar
    15 posts
    Member since:
    Sep 2009

    Posted 16 May 2011 Link to this post

    HI Vlad,

    Apologies for not replying sooner. I have been able to get the issue resolved with the help of your support team on another issue.

    The problem was not actually with the RadGridView but to any OBJECT tag embedded on the RadWindow page. For anyone else with the same issue please find below the explanation and solution to the problem provided by Telerik:

    1) Most of the reported problems (especially under FF) are not related to Silverlight in particular but to any OBJECT embedded on the page and can be reproduced with other objects e.g with a FLASH.

    2) The problems occur when the DOM is being modified - in particular, when overflow and display are changed.

    Since it will be best to keep the overflow and display changes in all other scenarios, we have decided not to change the source code for the time being but we developed the following workaround:


        <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Office2007"
            OnClientCommand="OnClientCommand" OnClientResizeStart="OnClientStart" OnClientDragStart="OnClientStart"
            OnClientResizeEnd="OnClientEnd" OnClientDragEnd="OnClientEnd">
            <Windows>
                <telerik:RadWindow ID="RadWindow1" runat="server" Title="PopUp Window" />
            </Windows>
        </telerik:RadWindowManager>
    <script type="text/javascript">
        /* Using RadWindowManager.open */
        function ShowExisting1() {
            //Call existing global function to obtain a reference to the window manager
            var oManager = GetRadWindowManager();
            //Show a particular existing window
            oManager.open("/ReloadIssueTestPage.aspx", "RadWindow1");
        }
        function OnClientCommand(sender, args) {
            args.set_cancel(true);
            sender._popupBehavior._manageVisibility = false;
            args.set_cancel(false);
            setTimeout(function () {
                sender._popupBehavior._manageVisibility = true;
            }, 200);
        }
        function OnClientStart(sender, args) {
            sender._popupBehavior._manageVisibility = false;
        }
        function OnClientEnd(sender, args) {
            setTimeout(function () {
                sender._popupBehavior._manageVisibility = true;
            }, 200);
        }
        Telerik.Web.UI.RadWindow.prototype._enablePageScrolling = function () {
        }
    </script>
Back to Top
DevCraft banner