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

[Solved] Can't enable column resizing in RadGrid

2 Answers 174 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Prerit
Top achievements
Rank 1
Prerit asked on 04 Jun 2009, 05:27 PM
Hi,
I want to use RadControls to maintain some of my data. First, I am testing its fuctionality to see if it can do all I need to. I created a Web Application with a RadGrid as the major element. Everything works fine in the RadGrid except for column resizing. I am able to import my data from SQL Server and reorder the columns and filter/sort and all that good stuff. However, as hard as I try, I cannot seem to make the columns resizable. I tried copying the code in html as well as C# into their appropriate files, but it just isn't working. I don't know why. If someone could help me with this problem, it would be much appreciated. Thank you.

2 Answers, 1 is accepted

Sort by
0
Prerit
Top achievements
Rank 1
answered on 04 Jun 2009, 07:29 PM
Here is my code. Could it be a simple problem of putting it in the wrong place??

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication2._Default" %> 
 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server">  
    <title></title>  
</head> 
<body> 
    <form id="form1" runat="server">  
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
    </telerik:RadScriptManager> 
    <div> 
      
    </div> 
    <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True"   
        DataSourceID="SqlDataSource1" GridLines="None" Skin="Outlook">  
<MasterTableView autogeneratecolumns="False" datasourceid="SqlDataSource1">  
<RowIndicatorColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</RowIndicatorColumn> 
 
<ExpandCollapseColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</ExpandCollapseColumn> 
    <Columns> 
        <telerik:GridBoundColumn DataField="ProductNumber" HeaderText="ProductNumber"   
            SortExpression="ProductNumber" UniqueName="ProductNumber">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="From" HeaderText="From"   
            SortExpression="From" UniqueName="From">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="IPCity" HeaderText="IPCity"   
            SortExpression="IPCity" UniqueName="IPCity">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="IPRegion" HeaderText="IPRegion"   
            SortExpression="IPRegion" UniqueName="IPRegion">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="IPCountry" HeaderText="IPCountry"   
            SortExpression="IPCountry" UniqueName="IPCountry">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Recieved" DataType="System.DateTime"   
            HeaderText="Recieved" SortExpression="Recieved" UniqueName="Recieved">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="StackTrace" HeaderText="StackTrace"   
            SortExpression="StackTrace" UniqueName="StackTrace">  
        </telerik:GridBoundColumn> 
    </Columns> 
</MasterTableView> 
        <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True">  
        <Resizing AllowRowResize="true" EnableRealTimeResize="true" ResizeGridOnColumnResize="true" 
                                AllowColumnResize="true"></Resizing> 
        </ClientSettings> 
    </telerik:RadGrid> 
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"   
        ConnectionString="<%$ ConnectionStrings:newDBConnectionString %>"   
        SelectCommand="SELECT * FROM [XMCrashes]"></asp:SqlDataSource> 
    </form> 
</body> 
</html> 
 
0
Accepted
Dimo
Telerik team
answered on 05 Jun 2009, 11:58 AM
Hello Prerit,

Your code is OK. If you are using IE8, please set zero margins for the <body> element. This issue will be fixed for our next release.

<body style="margin:0">

(external CSS may also be used)


All the best,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Prerit
Top achievements
Rank 1
Answers by
Prerit
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or