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

[Solved] GridView inside RadWindow resize issue

3 Answers 207 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jeremy
Top achievements
Rank 1
Jeremy asked on 03 Dec 2008, 06:30 PM
I have an issue with a GridView User Control as the content (with alignments set to Stretch) within a RadWindow.  When I resize the window enough to cover the data rows in the Grid the web browser locks up and I cannot continue within the current session.  This occurs in both IE 6 and FireFox.

I was able to write a couple sample xamls to illustrate the issue I am having.  After you open the new window and resize the window smaller (towards as small as it can go) the browser will hang. 

Following are the sample xaml snippets. 
Thank you for your help.
- Jeremy

Page.xaml (startup)

 

 

<UserControl x:Class="WindowExample.Page" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"   
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"   
    Width="400" Height="300">  
    <Grid x:Name="LayoutRoot" Background="White">  
        <Button x:Name="OpenWindowButton" Content="Open New Window" Width="150" Height="25" Click="OpenWindowButton_Click"/>  
    </Grid> 
</UserControl> 
 

 


Page.xaml.cs

using System.Windows;  
using System.Windows.Controls;  
using Telerik.Windows.Controls;  
 
namespace WindowExample {  
    public partial class Page : UserControl {  
        public Page() {  
            InitializeComponent();  
        }  
 
        private void OpenWindowButton_Click(object sender, RoutedEventArgs e) {  
            RadWindow NewWindow = new RadWindow();  
            NewWindow.Content = new ExampleGrid();  
            NewWindow.Show();  
        }  
    }  
}  
 

ExampleGrid.xaml
<UserControl x:Class="WindowExample.ExampleGrid" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"   
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"   
    xmlns:Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"   
    xmlns:GridView="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView"   
    > 
    <Grid x:Name="LayoutRoot" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">  
        <Controls:RadGridView Name="sampleRadGridView" ColumnsWidthMode="Fill" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">  
            <Controls:RadGridView.Columns> 
                <GridView:GridViewDataColumn HeaderText="CustomerID" IsReadOnly="True" UniqueName="CustomerID"    /> 
                <GridView:GridViewDataColumn HeaderText="CompanyName" IsReadOnly="True" UniqueName="CompanyName" /> 
                <GridView:GridViewDataColumn HeaderText="Country" UniqueName="Country" /> 
                <GridView:GridViewDataColumn HeaderText="City" UniqueName="City" /> 
                <GridView:GridViewDataColumn HeaderText="ContactName" UniqueName="ContactName" /> 
            </Controls:RadGridView.Columns> 
        </Controls:RadGridView> 
 
    </Grid> 
</UserControl> 

ExampleGrid.xaml.cs
using System;  
using System.Collections.ObjectModel;  
using System.Windows.Controls;  
using Telerik.Windows;  
using Telerik.Windows.Controls.GridView;  
using Telerik.Windows.Controls.GridView.Rows;  
 
namespace WindowExample {  
    public partial class ExampleGrid : UserControl {  
        private ObservableCollection<Customer> dataSource = new ObservableCollection<Customer>();  
 
 
        public ExampleGrid() {  
            InitializeComponent();  
            SetCustomerDataSource();  
            this.sampleRadGridView.AddHandler(GridViewRow.EditEndedEvent, new EventHandler<RecordRoutedEventArgs>(this.OnEditEnded));  
            this.sampleRadGridView.ItemsSource = this.dataSource;  
        }  
 
        private void OnEditEnded(object sender, RecordRoutedEventArgs e) {  
        }  
 
 
        private void SetCustomerDataSource() {  
              
            for (int i = 0; i < 10; i++) {  
                Customer aCustomer = new Customer();  
                aCustomer.CustomerID = i.ToString();  
                aCustomer.ContactName = "Customer " + i.ToString();  
                dataSource.Add(aCustomer);  
            }  
        }  
    }  
    public class Customer {  
        public string CustomerID { getset; }  
        public string CompanyName { getset; }  
        public string Country { getset; }  
        public string City { getset; }  
        public string ContactName { getset; }  
        public bool Bool { getset; }  
    }}  
 

3 Answers, 1 is accepted

Sort by
0
Nedyalko Nikolov
Telerik team
answered on 05 Dec 2008, 04:58 PM
Hello Jeremy,

Thank you for the feedback. I still investigate what happens when the RadGridView is resized to a very small size, but I need to research this further.

Probably, this is a bug in the RadGridView control.

I'll give you additional information as soon as possible.

Kind regards,
Nedyalko Nikolov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jeremy
Top achievements
Rank 1
answered on 05 Jan 2009, 06:15 PM
I am currently referencing the new futures build that was released (RadControls for Silverlight 2008 3 1217 Futures).  This release did seem to fix this issue for some instances. However if I am resizing and moving the window around the browser the issue does seem to still occur at times.  Unfortunately the way to reproduce the problem isn't as consistent as before.

I still seem to be able to recreate the issue with the code sample in the previous posting.  It is mostly just moving the window and resizing the window (using the corner resize) that seems to generate the issue.

Are you aware of any work arounds for this issue until it has been resolved?

If I can provide any other information about this issue please let me know and I'll do my best to do so.
Thank you for your help.
- Jeremy
0
Hristo
Telerik team
answered on 12 Feb 2009, 03:29 PM
Hi Jeremy,

This issue is already resolved and the fix will be included in our 2009 Q1 release.

Greetings,
Hristo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
Jeremy
Top achievements
Rank 1
Answers by
Nedyalko Nikolov
Telerik team
Jeremy
Top achievements
Rank 1
Hristo
Telerik team
Share this question
or