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

Cannot resize a Column to a smaller size when Width="*"

9 Answers 294 Views
GridView
This is a migrated thread and some comments may be shown as answers.
LHR
Top achievements
Rank 1
LHR asked on 24 Aug 2011, 02:41 PM
When I set Width="*" on any of my RadGridView columns, I cannot make the column smaller. I can make it bigger, but not smaller. 

The GridView I'm working with usually doesn't fill all available space, so I want to set a column width to * to make sure that it fills all remaining space, however on occasion the * column contains data that is too long and gets clipped. When users resize the column bigger to view the data, they cannot make it small again to view the rest of the data.

Is there a workaround for this? I don't want to use word wrapping.

I'm using RadControls for WPF, v.2011.1.419.40

9 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 24 Aug 2011, 02:59 PM
Hello Lhr,

 
Since you have defined a single star-sized column you would not be able to decrease this column. The only thing you have to do is to add an additional star-size column and everything should work as expected:


<telerik:RadGridView x:Name="radGridView" AutoGenerateColumns="False" ItemsSource="{Binding Collection}">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Header="OP1" Width="0.4*" DataMemberBinding="{Binding Property1}"/>
   <telerik:GridViewDataColumn Header="OP2" Width="100"  DataMemberBinding="{Binding Property1}"/>
                <telerik:GridViewDataColumn Header="OP3" Width="0.2*" DataMemberBinding="{Binding Property1}"/>
            </telerik:RadGridView.Columns>
</telerik:RadGridView>


Hope this helps!


Regards,
Vanya Pavlova
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
LHR
Top achievements
Rank 1
answered on 24 Aug 2011, 03:01 PM
I have already tried using two * sized columns, and the 1st column will work as expected but the 2nd one has the same behavior
0
Vanya Pavlova
Telerik team
answered on 24 Aug 2011, 03:07 PM
Hi Lhr,

 
May you post more info about the grid version you used? I have tested this behavior and everything works fine by my side. Will you please check the attached project and let me know how it differs from yours? 




Regards,
Vanya Pavlova
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
LHR
Top achievements
Rank 1
answered on 24 Aug 2011, 03:21 PM
If you add another Auto-Sized column at the end of your Column List, you'll notice the behavior with the last Star column

<telerik:RadGridView AutoGenerateColumns="False" ItemsSource="{Binding Collection}">
    <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn Header="P1" Width="100" DataMemberBinding="{Binding Property2}"/>
        <telerik:GridViewDataColumn Header="P1" Width="0.5*" DataMemberBinding="{Binding Property1}"/>
        <telerik:GridViewDataColumn Header="P1" Width="*" DataMemberBinding="{Binding Property3}"/>
         <telerik:GridViewDataColumn Header="P1" Width="Auto" DataMemberBinding="{Binding Property3}"/>
    </telerik:RadGridView.Columns>
</telerik:RadGridView>
0
Vanya Pavlova
Telerik team
answered on 24 Aug 2011, 03:39 PM
Hello Lhr,

 

Indeed we are aware of similar issue related to the column's resizing, with Width set to Auto.
For the time being I may suggest you to change the position last column and to combine it in a way similar to this one:


<telerik:GridViewDataColumn Header="P1" Width="Auto" DataMemberBinding="{Binding Property3}"/>
            <telerik:GridViewDataColumn Header="P1" Width="100" DataMemberBinding="{Binding Property2}"/>
            <telerik:GridViewDataColumn Header="P1" Width="0.5*" DataMemberBinding="{Binding Property1}"/>
            <telerik:GridViewDataColumn Header="P1" Width="*" DataMemberBinding="{Binding Property3}"/>


Hope this helps!


Kind regards,
Vanya Pavlova
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
LHR
Top achievements
Rank 1
answered on 24 Aug 2011, 03:47 PM
I cannot do that since the * Column is the 2nd column in a list of about 8-10 columns and because of it's data it should not be the last one. I cannot * size my last columns since they are buttons and should not be * sized

For now I just won't use * Columns, but I would appreciate if you fixed this in the future
0
Chris
Top achievements
Rank 1
answered on 23 Nov 2011, 11:22 PM
I recently ran into this on the latest .NET 3.5 version of the GridView when working with a * column and several auto columns. I tried adding a second * column which will make the first * column able to be shrunk but not the second.

Is there any update to this issue? Workaround or is there a ticket I can follow to know when this has been fixed?

Thanks in advance,
  Chris
0
Chris
Top achievements
Rank 1
answered on 23 Nov 2011, 11:23 PM
[Edit] Was a double post.
It said there was a server error posting... Guess it still posted... 
0
Chris
Top achievements
Rank 1
answered on 23 Nov 2011, 11:23 PM
 
Tags
GridView
Asked by
LHR
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
LHR
Top achievements
Rank 1
Chris
Top achievements
Rank 1
Share this question
or