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

[Solved] Can't change column widths

2 Answers 171 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rick
Top achievements
Rank 1
Rick asked on 03 Jul 2009, 09:43 AM
Can someone just point me in the right direction with this? I can't seem to be able to change my column widths:

                        <telerik:RadGrid ID="RadGridDentistsNotes" runat="server" AutoGenerateColumns="False" TableLayout="Fixed">             
                            <MasterTableView DataSourceID="odsDentistsNotes" DataKeyNames="NoteID">                                                                                       
                                <Columns>                                                                                                                                    
                                    <telerik:GridBoundColumn DataField="NoteDate" HeaderText="Date" HeaderStyle-Width="50px" />                                    
                                    <telerik:GridTemplateColumn HeaderText="Note"
                                    <ItemTemplate> 
                                        <%#BLL.Functions.SummaryStr(Eval("Note"), 40)%> 
                                    </ItemTemplate> 
                                    </telerik:GridTemplateColumn> 
                                                                                                                                                                      
                                    <telerik:GridBoundColumn DataField="FK_UserFullName" HeaderText="User" HeaderStyle-Width="50px" />                                     
                                </Columns>                                                                  
                            </MasterTableView>                             
                             
                            <ClientSettings EnableRowHoverStyle="true">    
                                <Selecting AllowRowSelect="true" />          
                            </ClientSettings>                                   
                        </telerik:RadGrid>       

Actually I should point out that the widths are set when the grid contains no data, but when I rebind the grid and load data, the widths go back to standard.

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 03 Jul 2009, 11:17 AM
Hi Rick,

Try setting the TableLayout property of grid MasterTableView to "Fixed" and see whether it is working as expected.

Thanks,
Princy.
0
Rick
Top achievements
Rank 1
answered on 03 Jul 2009, 12:53 PM
Thanks!
Tags
Grid
Asked by
Rick
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Rick
Top achievements
Rank 1
Share this question
or