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

dynamic width of column

3 Answers 87 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Christian
Top achievements
Rank 1
Christian asked on 30 Jul 2009, 10:01 AM
Hello,

how can I configure the radGrid so that the columns geht automaticly the width so that all data are shown without a break.

Herer is the code

    <rc:TelerikGrid AutoSave="false" ID="RadGrid1" runat="server" SkinID="List" DataSourceID="" 
        AllowSorting="false" Width="100%" AutoGenerateColumns="true" ShowGroupPanel="false"   
        ShowFooter="false" AllowPaging="false" PageSize="20"  enableajax="false"   
        GroupingEnabled="false" AllowFilteringByColumn="true" ToolTip="false">  
        <ClientSettings AllowDragToGroup="false" AllowExpandCollapse="false" AllowGroupExpandCollapse="false" > 
            <Scrolling ScrollHeight="460px" SaveScrollPosition="false" /> 
            <ClientEvents OnMasterTableViewCreated="hide_MasterApp_Updateprogress" /> 
        </ClientSettings> 
        <HeaderStyle  Width="150" Wrap="true" /> 
        <ItemStyle Wrap="false" />   
        <MasterTableView CssClass="MasterTable" CommandItemDisplay="None"   
            GroupLoadMode="Server">  
            <RowIndicatorColumn UniqueName="RowIndicator" Visible="false">  
                <HeaderStyle Width="20px" /> 
            </RowIndicatorColumn> 
        </MasterTableView> 
    </rc:TelerikGrid> 

3 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 30 Jul 2009, 10:16 AM
Hello Christian,

You can set the TableLayout property of the MasterTableView as Auto whihc will automatically set the width of the columns to the maximum text length in the column:
aspx:
<MasterTableView CssClass="MasterTable" TableLayout="Auto" CommandItemDisplay="None" GroupLoadMode="Server">   
            <RowIndicatorColumn UniqueName="RowIndicator" Visible="false">   
                <HeaderStyle Width="20px" />  
            </RowIndicatorColumn>  
</MasterTableView>  
 

Thanks
Shinu.
0
siddhes
Top achievements
Rank 1
answered on 22 Sep 2014, 06:29 AM
Hi, i need to generate columns dynamically and sometime it has to display more thaqn 50 columns. In my gridview if i use resize property then i can't able to use vertical scrolling. If i don't use the resize property column width are not in correct fomat. Help me in this. Thanks in advance
0
Venelin
Telerik team
answered on 24 Sep 2014, 10:24 AM
Hi siddhes

" i can't able to use vertical scrolling"
--> form the provided information I cannot be entirely sure for the cause of the problem, but in general, vertical scroll will appear only if data items overflow, i.e their height exceed grid's height and scrolling is enabled. Therefore, could you please send your code (markup/code-behind) so we can review your settings and if everything is set up correctly? Also, if you have some custom styles on the page, please disable them for testing purposes and see if the issue persist.

n the meantime I would suggest you to refer to these help articles:

http://www.telerik.com/help/aspnet-ajax/grid-basics-crolling.html

http://www.telerik.com/help/aspnet-ajax/grid-scroll-with-static-headers.html


Regards,
Venelin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Christian
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
siddhes
Top achievements
Rank 1
Venelin
Telerik team
Share this question
or