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

Column Resizing Problem

8 Answers 126 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Antony
Top achievements
Rank 1
Antony asked on 15 Jan 2009, 11:16 AM
Hi,

Can anyone help with this? Resizing RadGrid columns isn't working properly for me, they either get really large (usually when I want them to be smaller) or really small (they sometimes disappear). Below is my implementation of the Grid, it is contained within a SplitterPane.

I'm sure I am missing something but I don't know what.

<telerik:RadGrid ID="RadGrid1" runat="server" OnItemDataBound="RadGrid_ItemDataBind" GridLines="None" Skin="Vista" AllowMultiRowSelection="True" 
            AllowPaging="true" AllowSorting="True" ShowStatusBar="true" 
            PageSize="30" Width="100%" Height="100%" OnNeedDataSource="RadGrid1_NeedDataSource" > 
        <StatusBarSettings ReadyText="Ready" LoadingText="Loading items..." /> 
        <MasterTableView AutoGenerateColumns="False" Width="100%" DataKeyNames="ID" TableLayout="Fixed"
            <PagerStyle Visible="false" /> 
             
            <Columns> 
                <telerik:GridTemplateColumn UniqueName="ID" DataType="System.Int32" Display="false"
                    <ItemTemplate><%# Eval("ID") %></ItemTemplate
                </telerik:GridTemplateColumn> 
                <telerik:GridClientSelectColumn UniqueName="column"
                    <HeaderStyle Width="3%" /> 
                                       
                </telerik:GridClientSelectColumn> 
                <telerik:GridTemplateColumn UniqueName="NameColumn" DataType="System.String" HeaderText="Name"
                    <HeaderStyle Width="15%" /> 
                    <ItemStyle Wrap="false" /> 
                    <ItemTemplate><asp:Label ID="lblName" runat="server"></asp:Label></ItemTemplate
                </telerik:GridTemplateColumn> 
                 
                <telerik:GridTemplateColumn UniqueName="ConstituencyColumn" DataType="System.String" HeaderText="Constituency"
                    <HeaderStyle Width="25%" /> 
                     
                    <ItemTemplate><asp:Label ID="lblConstituency" runat="server"></asp:Label></ItemTemplate
                </telerik:GridTemplateColumn> 
                <telerik:GridTemplateColumn UniqueName="PartyColumn" DataType="System.String" HeaderText="Party"
                    <HeaderStyle Width="10%" /> 
                     
                    <ItemTemplate><asp:Label ID="lblParty" runat="server"></asp:Label></ItemTemplate
                </telerik:GridTemplateColumn> 
                <telerik:GridTemplateColumn UniqueName="JobColumn" DataType="System.String" HeaderText="Job"
                    <HeaderStyle Width="20%" /> 
                     
                    <ItemTemplate><asp:Label ID="lblJob" runat="server"></asp:Label></ItemTemplate
                </telerik:GridTemplateColumn> 
                <telerik:GridTemplateColumn UniqueName="EmailColumn" DataType="System.String" HeaderText="Email"
                    <HeaderStyle Width="25%" /> 
                     
                    <ItemTemplate><asp:HyperLink ID="lblEmail" runat="server"></asp:HyperLink></ItemTemplate
                </telerik:GridTemplateColumn> 
            </Columns> 
        </MasterTableView> 
                    <ClientSettings AllowColumnsReorder="False"
                    <Resizing AllowColumnResize="true" EnableRealTimeResize="false"  
                     ResizeGridOnColumnResize="false" ClipCellContentOnResize="false" /> 
                    <Scrolling AllowScroll="True" UseStaticHeaders="True" ScrollHeight="1" /> 
                    <Selecting AllowRowSelect="True" /> 
                    <ClientEvents   OnRowClick="RadGrid1_RowClick"  
                                    OnRowSelected="RadGrid1_RowSelected"  
                                    OnRowDeselected="RadGrid1_RowSelected" 
                                    OnScroll="RadGrid1_Scroll"  
                                    /> 
                    </ClientSettings> 
                     
        </telerik:RadGrid> 

Thanks in advance

Antony

8 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 19 Jan 2009, 12:56 PM
Hello Antony,

Does setting ClientSettings -> Resizing -> ResizeGridOnColumnResize = true makes a difference and produces the desired result on column resizing? You may also tweak with the settings presented in the following online demo of the control to see which configuration suits your needs:

http://demos.telerik.com/aspnet-ajax/Grid/Examples/Client/Resizing/DefaultCS.aspx

Best regards,
Sebastian
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Antony
Top achievements
Rank 1
answered on 19 Jan 2009, 03:38 PM
Hello Sebastian,

I've tried what you suggested and it still doesn't work, I can't seem to repicate the error using the demo. The grid is contained within a SplitterPane and is thus unable to grow, could that have anything to do with the problem?

Thanks,

Antony
0
Sebastian
Telerik team
answered on 19 Jan 2009, 03:40 PM
Hi Antony,

Can you please check whether moving the grid outside of the splitter panel make a difference? You may also compare the behavior under different browsers (IE and Gecko-based for example) to see whether this will shed some additional light on the matter.

Kind regards,
Sebastian
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Antony
Top achievements
Rank 1
answered on 19 Jan 2009, 04:02 PM
Hi Sebastian,

I've moved the RadGrid out of the SplitterPane but it has made no difference. It also doesn't work on FireFox either

Thanks,

Antony
0
Sebastian
Telerik team
answered on 22 Jan 2009, 01:48 PM
Hello Antony,

Unfortunately I am still not able to recreate the abnormality locally. The best means to progress in our investigation is to isolate a stripped working version of your project and send it enclosed to a formal support ticket. I will test it locally and will get back to you with my findings.

Best regards,
Sebastian
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Antony
Top achievements
Rank 1
answered on 22 Jan 2009, 04:36 PM
Hi Sebastian,

I now know why the problem is happening, it is because I have a hidden column.

<telerik:GridTemplateColumn UniqueName="ID" DataType="System.Int32" Display="false">  
    <ItemTemplate><%# Eval("ID") %></ItemTemplate>  
</telerik:GridTemplateColumn> 

When I change Display="false" to Display="true"

<telerik:GridTemplateColumn UniqueName="ID" DataType="System.Int32" Display="true">  
    <ItemTemplate><%# Eval("ID") %></ItemTemplate>  
</telerik:GridTemplateColumn> 

The problem goes away. I do want the column to be hidden though, what are your thoughts?

Thanks,

Antony
0
Antony
Top achievements
Rank 1
answered on 22 Jan 2009, 05:15 PM
Hi Sebastian,

I have managed to solve my problem by removing the hidden column and using the ClientDataKeysName property to access the row identifier instead. I didn't manage to find out why resizing didn't work when a column was hidden. If you find out then I would be interested to know.

Thanks again for your time and help

Antony
0
Pavel
Telerik team
answered on 23 Jan 2009, 10:53 AM
Hi Antony,

I cannot reproduce the described problem with the given information. You can find attached to this message a sample website created for testing. Try it and let us know if you can replicate the issue with it as well.

Best wishes,
Pavel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Antony
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Antony
Top achievements
Rank 1
Pavel
Telerik team
Share this question
or