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

Column resize loses auto-layout of other columns

3 Answers 177 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dan Frumin
Top achievements
Rank 1
Dan Frumin asked on 07 Apr 2010, 07:07 PM
Hi there,

My desired behavior is:
* On initial rendering of the grid, the columns are auto-sized to their contents (I set Table Layout = "auto")
* The user can resize columns to make them bigger or smaller (I set the resize options to true, real time resize, and resize grid on resize)
* On postback / pagination I want all columns to retain widths

Issue:
* On postback the user sized columns retain widths but all other columns shrink as if Table Layout was set to Fixed with no scrolling.

My grid follows.

thanks!

d

                <telerik:RadGrid ID="RadGrid1" Width="100%" Height="450px" AllowPaging="True" PageSize="15"  
                    runat="server" AllowSorting="False" OnNeedDataSource="RadGrid1_NeedDataSource" 
                    GridLines="None" AllowFilteringByColumn="False" ShowGroupPanel="False" EnableHeaderContextMenu="False" 
                    OnColumnCreated="RadGrid1_ColumnCreated" OnColumnCreating="RadGrid1_ColumnCreating" 
                    OnDataBound="RadGrid1_DataBound" OnPreRender="RadGrid1_PreRender" EnableViewState="false" 
                    OnItemDataBound="RadGrid1_ItemDataBound"
                    <HeaderContextMenu EnableAutoScroll="True"
                    </HeaderContextMenu> 
                    <MasterTableView Width="100%" AutoGenerateColumns="true" EnableColumnsViewState="false" TableLayout="Auto" /> 
                    <PagerStyle Mode="NextPrevAndNumeric"  
                        FirstPageImageUrl="/images/pagingfirst.gif"  
                        LastPageImageUrl="/images/paginglast.gif"  
                        NextPageImageUrl="/images/pagingnext.gif"  
                        PrevPageImageUrl="/images/pagingprev.gif" /> 
                    <ClientSettings AllowColumnsReorder="False" AllowDragToGroup="False" ReorderColumnsOnClient="False" 
                        Resizing-AllowColumnResize="True" Resizing-AllowRowResize="False" Resizing-ClipCellContentOnResize="False" 
                        Resizing-EnableRealTimeResize="True" Resizing-ResizeGridOnColumnResize="True"
                        <Scrolling AllowScroll="True" UseStaticHeaders="True" /> 
                    </ClientSettings> 
                    <FilterMenu EnableTheming="False"
                        <CollapseAnimation Duration="200" Type="OutQuint" /> 
                    </FilterMenu> 
                </telerik:RadGrid> 

3 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 12 Apr 2010, 09:43 AM
Hi Dan,

Please, try setting the UseStaticHeaders property to false if you want the header scrolls along with the data rows.
<ClientSettings >  
   <Scrolling UseStaticHeaders="false" AllowScroll="true" />  
 </ClientSettings>  

For more information about scrolling and static headers, please refer to the help article below:
Scroll with static headers

Give this suggestion a try and let me know about the result. 

Sincerely yours,
Pavlina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Dan Frumin
Top achievements
Rank 1
answered on 12 Apr 2010, 10:11 AM
Hi Pavlina,

Unfortunately, scrolling the headers with the rows is not one of the things I'm after in my desired behavior.  I like Static Headers.  They're nice.  :-)

What I'm looking for is to allow a user to manually size some columns and let the others continue to auto-size.  The problem is that when a user manually sizes one column the rest lose the auto-size and go to a fixed size.  That's not the desired or best behavior...

What can be done?

d
0
Pavlina
Telerik team
answered on 14 Apr 2010, 04:45 PM
Hello Dan,

What you can do is to set TableLayout="Fixed" for the MasterTableView and remove the MasterTableView width. In this case the table will expand to 100% automatically. When you do this, all columns will become equally wide, so in addition, you can also set column widths using HeaderStyle-Width.

Let us know if you need more information.

Best wishes,
Pavlina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Dan Frumin
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Dan Frumin
Top achievements
Rank 1
Share this question
or