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

Can't extend grid width

6 Answers 145 Views
GridView
This is a migrated thread and some comments may be shown as answers.
ofer alper
Top achievements
Rank 1
ofer alper asked on 09 Feb 2010, 09:57 AM
Hi,

User can't extend the grid width (No max width is set)

i do the following:
1) I open window
2) create a new UserControl with the radGrid
3) put the userControl in the window

It happens on every grid.
I tried to "play" with the width/max width of the grid and of the user control but with no success.


Thanks,
Ofer

6 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 09 Feb 2010, 10:13 AM

Hi ofer alper,

We were unable to reproduce the problem. If you could post some XAML code we might be able to spot the problematic code.


Best wishes,
Milan
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
ofer alper
Top achievements
Rank 1
answered on 09 Feb 2010, 10:46 AM
The xaml:
I tried to change/remove the width/height from the UserControl and/or from the grid

<UserControl x:Name="gridcontrol"
   x:Class="SampleWpfDataGrid.GridTest"
   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   xmlns:Controls="clr-namespace:SampleWpfDataGrid.Controls"        
   xmlns:telerikGrid="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
   xmlns:UserControls="clr-namespace:SampleWpfDataGrid.UserControls"        
   Width="900" Height="900"          
>
    <Grid>

        <telerikGrid:RadGridView x:Name="radGridTest" ColumnReordered="radGridTest_ColumnReordered" AutoGenerateColumns="False" DataLoadMode="ASynchronous" Width="900" Height="900" Opacity="1.0">
            <telerikGrid:RadGridView.Columns>

                <telerikGrid:GridViewDataColumn
                Width="100" Header="C2"
                DataMemberBinding="{Binding Mode=OneWay, Path=x2}" IsReadOnly="True" />


                <telerikGrid:GridViewDataColumn
                Width="100" Header="C3"
                DataMemberBinding="{Binding Mode=OneWay, Path=x2}" IsReadOnly="True" />


            </telerikGrid:RadGridView.Columns>
        </telerikGrid:RadGridView>
        
    </Grid>
</UserControl>

The code to open the window:

            var mainWindow = new Window
            {
                Content = new GridTest(),
                Title = title,
                WindowState = WindowState.Maximized,
                Width = width,
                Height = height,
                MaxWidth = width,
                MaxHeight = height,

            };
            mainWindow.Show();
            mainWindow.BringIntoView();



0
Milan
Telerik team
answered on 09 Feb 2010, 11:12 AM
Hi ofer alper,

Well, everything seems to be okay. Isn't the grid resized to 900x900 ?


Greetings,
Milan
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
ofer alper
Top achievements
Rank 1
answered on 09 Feb 2010, 11:19 AM
Yes it is. But how can the user extend the width to be more than 900? There is no MaxWidth of 900.

I would expect that the user will be able to resize the lase column and extend the grid width. No?


Thanks,

Ofer
0
Milan
Telerik team
answered on 09 Feb 2010, 11:54 AM
Hello ofer alper,

When you set explicit Width to RadGridView it will not be able to resize when its last column is resized. You should remove the explicit Width and possibly replace it with MinWidth of 900. That way the grid will have initial size of 900 and you will be able to extent its Width.


Greetings,
Milan
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
ofer alper
Top achievements
Rank 1
answered on 09 Feb 2010, 12:16 PM
Now i have more serious problem. The grid width is like the window width, no matter which MinWidth i set

In this example i set the MinWidth of the grid to 100 but still the grid width was all over the window and i couldn't resize it,



<UserControl x:Name="gridcontrol"
   x:Class="SampleWpfDataGrid.GridTest"
   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   xmlns:Controls="clr-namespace:SampleWpfDataGrid.Controls"        
   xmlns:telerikGrid="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
   xmlns:UserControls="clr-namespace:SampleWpfDataGrid.UserControls"        
>
    <Grid>

        <telerikGrid:RadGridView x:Name="radGridTest" ColumnReordered="radGridTest_ColumnReordered" AutoGenerateColumns="False" DataLoadMode="ASynchronous" MinWidth="100" Height="300">
            <telerikGrid:RadGridView.Columns>

                <telerikGrid:GridViewDataColumn
                Header="C2"
                DataMemberBinding="{Binding Mode=OneWay, Path=x2}" IsReadOnly="True" />


                <telerikGrid:GridViewDataColumn
                Header="C3"
                DataMemberBinding="{Binding Mode=OneWay, Path=x2}" IsReadOnly="True" />


            </telerikGrid:RadGridView.Columns>
        </telerikGrid:RadGridView>
        
    </Grid>
</UserControl>



Tags
GridView
Asked by
ofer alper
Top achievements
Rank 1
Answers by
Milan
Telerik team
ofer alper
Top achievements
Rank 1
Share this question
or