Grid width problem

9 posts, 0 answers
  1. ofer alper
    ofer alper avatar
    21 posts
    Member since:
    Nov 2009

    Posted 02 Feb 2010 Link to this post

    I have the following problem:

    I open big window with a radgrid. and when i resize the window (reduce the width) the grid's margins is outside the window.
    It happens with all grids. I tried to "play" with width, max width etc but it doesn't help

    See attached file.

    This is the code for opening the window

            private int resolutionWidth = 1920;
            private int resolutionHeight = 1200;

                var mainWindow = new TaskbarRadWindow
                {
                    Content = contect,
                    Header = title,
                    WindowState = WindowState.Normal,
                    Width = resolutionWidth,
                    Height = resolutionHeight,
                    MaxWidth = resolutionWidth,
                    MaxHeight = resolutionHeight,
                };

    Thanks,
    Ofer
  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 03 Feb 2010 Link to this post

    Hello Ofer Alper,

     Could you please send us a sample project that reproduces the problem. This would be of great help in investigating what the problem is.

    Sincerely yours,
    Miroslav Nedyalkov
    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. ofer alper
    ofer alper avatar
    21 posts
    Member since:
    Nov 2009

    Posted 03 Feb 2010 Link to this post

    I can't attach my solution and can't submit support ticket. do you have a email when i can send it?

    Another severe problem that i have it that i cannot enlarge the grid width, although i didn't set MaxWidth.

    Here is a sample of grid. But it happens in all rad grids. I can't resize the last column, it behaves as if the MaxWidth is set.

    I also checked in the code and the MaxWidth is not set (i.e. infinity)

    <UserControl x:Class="gridtest.GridTest"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:telerikGrid="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
        Height="1000" Width="1000">
        <Canvas>
            <telerikGrid:RadGridView x:Name="radGridTest" AutoGenerateColumns="False" Width="1500" Height="1000" Canvas.Left="0" Canvas.Top="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>

        </Canvas>
    </UserControl>

  5. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 03 Feb 2010 Link to this post

    Hello Ofer Alper,

      Do you put this UserControl into a RadWindow? If yes, please notice that the UserControl has its Width and Height properties set to 100. The GridView has also its Width and Height properties set. This might be the reason why it doesn't resize.

    About attaching the project - unfortunately our forums doesn't support attaching projects.

    All the best,
    Miroslav Nedyalkov
    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.
  6. ofer alper
    ofer alper avatar
    21 posts
    Member since:
    Nov 2009

    Posted 03 Feb 2010 Link to this post

    Yes i put the UserControl inside RadWindow but i didn't specify the widht and the height of the UserControl and i didn't specify the MaxWidth of the RagGrid.

    How can i make it work ?

    Thanks,

    Ofer
  7. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 03 Feb 2010 Link to this post

    Hi Ofer Alper,

     You specify them in the XAML you sent. Here:

    <UserControl x:Class="gridtest.GridTest"
        xmlns:telerikGrid="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
        Height="1000" Width="1000">
        <Canvas>
            <telerikGrid:RadGridView x:Name="radGridTest" AutoGenerateColumns="False" Width="1500" Height="1000" Canvas.Left="0" Canvas.Top="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>
     
        </Canvas>
    </UserControl>
    The Width and Height of both - the UserControl and the RadGridView are specified.

    Best wishes,
    Miroslav Nedyalkov
    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.
  8. ofer alper
    ofer alper avatar
    21 posts
    Member since:
    Nov 2009

    Posted 03 Feb 2010 Link to this post

    It still doesn't let me to enlarge the grid width.
    I need that the user will be able to resize the columns and enlarge the grid if necessary.

    I did not set MaxWidth of the userControl or on the Grid

    Ofer
  9. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 04 Feb 2010 Link to this post

    Hello Ofer Alper,

    I just noticed that you are using Canvas panel - it causes the problem (besides the Width and Height of the UserControl and the GridView). Please, refer to the attached project - I changed the Canvas with Grid panel.

    Sincerely yours,
    Miroslav Nedyalkov
    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.
  10. ofer alper
    ofer alper avatar
    21 posts
    Member since:
    Nov 2009

    Posted 04 Feb 2010 Link to this post

    I tried grid also it is not working. I can't resize (enlarge my radgrid).

    My code is very simple and it is very easy to reproduce  i do the following :

    1) Open Window
    2) create a new GridTest user control
    3) set the GridTest as the content of this window.


    I didn't define maxWidth of the grid or of the user control. I tried every possible parameter (add width to the user control, remove width from the user control etc)

    Please Help.

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

            <telerikGrid:RadGridView x:Name="radGridTest" ColumnReordered="radGridTest_ColumnReordered" AutoGenerateColumns="False" DataLoadMode="ASynchronous" Width="1000" Height="1000" 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>
Back to Top
UI for WPF is Visual Studio 2017 Ready