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

auto resize grid

7 Answers 444 Views
GridView
This is a migrated thread and some comments may be shown as answers.
ronald
Top achievements
Rank 1
ronald asked on 15 Jan 2011, 12:34 PM
Hi,

how to make the gridview auto resize while the user adjusting the window?

thanks

7 Answers, 1 is accepted

Sort by
0
SweNz
Top achievements
Rank 1
answered on 16 Jan 2011, 07:32 AM
Hi ronald ,

do not define any weight or height. Gridview size will adjust by window size or its layout automatically

hope this help happy sunday :)

SweNz
0
ronald
Top achievements
Rank 1
answered on 16 Jan 2011, 11:32 PM
Hi,

thanks for the info.

My grid is in the raddocking and the raddcoking is in the dockpanel. Now if the user expands the window the docking and dockpanel does not expand automatically. How can I make those controls auto-resize?

thanks
0
Accepted
Vanya Pavlova
Telerik team
answered on 17 Jan 2011, 04:23 PM
Hello Ronald,

 
RadGridView is auto-sized by default, which means that its default Width/Height properties are set to Auto. In addition to this if you need to have column resizing enabled just set the ColumnWidth property of RadGridView to star, or set the Width property of last column to star.
Please refer to the following snippet:

<DockPanel x:Name="LayoutRoot" DataContext="{Binding Source={StaticResource SampleDataSource}}">
        <telerik:RadDocking>
           <telerik:RadDocking.DocumentHost>
          <telerik:RadSplitContainer>
           <telerik:RadPaneGroup>
               <telerik:RadPane Header="Description">
                  <telerik:RadGridView ColumnWidth="*" ItemsSource="{Binding Collection}" AutoGenerateColumns="True"/>
               </telerik:RadPane>
           </telerik:RadPaneGroup>
       </telerik:RadSplitContainer>
   </telerik:RadDocking.DocumentHost>
</telerik:RadDocking>
    </DockPanel>

 

 

Best wishes,
Vanya Pavlova
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
ronald
Top achievements
Rank 1
answered on 18 Jan 2011, 12:21 AM
Hi,

Please see attached for the overall structure of the controls. Hope the image will explain alot better of what I'm trying to achieve.

thanks
0
Vanya Pavlova
Telerik team
answered on 18 Jan 2011, 05:06 PM
Hello Ronald,

 
Can you please try to implement the approach shown below in my previous reply, based on your custom scenario and let me know with which part of the solution you encounter any difficulties.
I would be glad if I can assist you further.

Greetings,
Vanya Pavlova
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
ronald
Top achievements
Rank 1
answered on 18 Jan 2011, 11:29 PM
I did try the sample you suggested but it didn't work.
It does not auto-resize the frame and the dockpanel so obviously the grid will not grow or shrink automatically.
0
Vanya Pavlova
Telerik team
answered on 19 Jan 2011, 10:26 AM
Hello Ronald,

 
I believe that your case is specific and you may send us small application via support ticket with this layout and we would be able to provide you with an appropriate solution.

Greetings,
Vanya Pavlova
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
GridView
Asked by
ronald
Top achievements
Rank 1
Answers by
SweNz
Top achievements
Rank 1
ronald
Top achievements
Rank 1
Vanya Pavlova
Telerik team
Share this question
or