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

Resize Column Shrinks Grid

4 Answers 143 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 12 Sep 2008, 08:27 PM
I have ten columns in a RadGrid and when I resize a column the grid shrinks on both sides. 

How do I keep the grid at 99% and prevent it from shrinking when I resize a column
?
  <telerik:RadGrid ID="RadGrid1"   
                                          AllowMultiRowSelection="True"   
                                          AllowSorting="True"   
                                          AllowPaging="False"   
                                          AutoGenerateColumns="False"                                                    
                                          AllowAutomaticUpdates="True"   
                                          AlternatingItemStyle-HorizontalAlign="Center"   
                                          BackColor="#ffffff"                                                  
                                          EnableEmbeddedSkins="False"   
                                          GridLines="None"   
                                          GroupingEnabled="True"   
                                          HeaderStyle-Height="20"   
                                          Height="425px"                                                                 
                                          ItemStyle-HorizontalAlign="Center"   
                                          OnSortCommand="RadGrid1_SortCommand"   
                                          OnNeedDataSource="RadGrid1_NeedDataSource"   
                                          OnItemDataBound="RadGrid1_ItemDataBound"   
                                          OnItemCommand="RadGrid1_ItemCommand"   
                                          ShowFooter="True" 
                                          ShowHeader="True"   
                                          ShowGroupPanel="True"   
                                          ShowStatusBar="True"   
                                          Skin="MySkin"    
                                          Width="99%"   
                                          runat="server"

<MasterTableView DataKeyNames="ID,NAME" EnableColumnsViewState="True" EditMode="EditForms" AllowMultiColumnSorting="True" Width="100%"

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 15 Sep 2008, 05:12 AM
Hi George,

Try setting the TableLayout property to Fixed and see whether the Grid is shrinking on resize.

ASPX:
<MasterTableView AutoGenerateColumns="False" TableLayout="Fixed" Width="99%" DataSourceID="SqlDataSource1" > 
             

Shinu.
0
Mike
Top achievements
Rank 1
answered on 15 Sep 2008, 05:44 PM
I tried that and the table still shrinks on both sides.
0
Accepted
Shinu
Top achievements
Rank 2
answered on 16 Sep 2008, 05:09 AM
Hi George,

Have you set ResizeGridOnColumnResize property to true? When this property is set to False (the default), the grid preserves its size and resizes the rest of the columns evenly. If you set ResizeGridOnColumnResize to True, the grid changes its size dynamically when the user resizes a column. All other columns retain their original sizes.
Resizing columns

Shinu.


0
Mike
Top achievements
Rank 1
answered on 16 Sep 2008, 01:30 PM
Shinu,

Thank you just what I was looking for.....  There are soo many settings on this Grid it will take a year just to try them all. :)

Tags
Grid
Asked by
Mike
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Mike
Top achievements
Rank 1
Share this question
or