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

[Solved] Fixed Width Column

1 Answer 128 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.
Michael
Top achievements
Rank 1
Michael asked on 09 Jun 2009, 12:55 AM
Hello,

Is there a way to make a column a fixed width? By this I mean, a column that the User can not drag to increase its size. I would also like this fixed width to ignore the ColumnsWidthMode of Fill on the grid and always stay a preset fixed width.

I tried defining the GridViewCell Template with a fixed Width, but that didn't seem to have an effect.

Can this be done?

1 Answer, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 09 Jun 2009, 09:26 AM
Hello Michael,

If you explicitly set the Width property of a column this width will be respected even if the ColumnsWidthMode is set to Fill. We have also introduced a new property for our columns called IsResizable which you can use to disallow column resizing.
Here is a snippet that can help you configure the grid for your scenario:

<telerikGrid:RadGridView   
    x:Name="RadGridView1"   
    AutoGenerateColumns="False" ColumnsWidthMode="Fill">  
    <telerikGrid:RadGridView.Columns> 
        <telerikGrid:GridViewDataColumn   
            UniqueName="Sender" IsResizable="False"  Width="30"/>  
        <telerikGrid:GridViewDataColumn   
            UniqueName="Size"/>  
    </telerikGrid:RadGridView.Columns> 
</telerikGrid:RadGridView> 

I am also sending you the latest trial assemblies that include the IsResizable property.

Greetings,
Milan
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
Michael
Top achievements
Rank 1
Answers by
Milan
Telerik team
Share this question
or