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

[Solved] Problem with grid height in Q2 2009 control

1 Answer 161 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Scott R
Top achievements
Rank 1
Scott R asked on 22 Jul 2009, 04:34 PM
I upgraded to the Q2 2009 controls and now the height of the RadGrid does not appear to work correctly when the RadGrid is inside a RadSplitter. The grid height should be 100%. This works with the Q1 2009 controls, but not the Q2 2009 controls. Here is a simple example:

Default.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %> 
 
<!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>  
    <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" /> 
    <style type="text/css">  
        html,  
        body,  
        form  
        {  
            margin: 0;  
            height: 100%;  
            border: 0;  
            padding: 0;  
            overflow: hidden;  
        }  
    </style> 
</head> 
<body> 
    <form id="form1" runat="server">  
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
    </telerik:RadScriptManager> 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
    </telerik:RadAjaxManager> 
   
    <telerik:RadSkinManager ID="RadSkinManager1" Runat="server" Skin="Outlook">  
    </telerik:RadSkinManager> 
    <div> 
 
 
<telerik:RadSplitter ID="RadSplitter1" runat="server" Orientation="Horizontal" Width="100%" Height="100%" BorderSize="0">  
    <telerik:RadPane ID="Toolbar" runat="server" SkinID="TabToolBarPane">  
    </telerik:RadPane> 
    <telerik:RadPane ID="InvoiceListRadPane" runat="server" Scrolling="Both" BorderStyle="None" style="border: 0 0 0 0;">  
        <telerik:RadGrid ID="InvoiceGrid" runat="server" AllowSorting="true" AllowPaging="true" PageSize="25" PagerStyle-AlwaysVisible="true" EnableViewState="false" AllowMultiRowSelection="true" style="border:0; outline:none" Width="100%" Height="100%">  
            <MasterTableView DataKeyNames="Id" ClientDataKeyNames="Id" TableLayout="Auto" AutoGenerateColumns="false" EnableViewState="false">  
                <NoRecordsTemplate> 
                    No records to display.  
                </NoRecordsTemplate> 
                <Columns> 
                    <telerik:GridClientSelectColumn HeaderStyle-Width="30px" /> 
                    <telerik:GridBoundColumn UniqueName="InvoiceDate" SortExpression="InvoiceDate" HeaderText="Invoice Date" DataField="InvoiceDate" DataFormatString="{0:d}">  
                        <HeaderStyle Width="95px"></HeaderStyle> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn UniqueName="DueDate" SortExpression="DueDate" HeaderText="Due Date" DataField="DueDate" DataFormatString="{0:d}">  
                        <HeaderStyle Width="85px"></HeaderStyle> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn UniqueName="InvoiceNumber" SortExpression="InvoiceNumber" HeaderText="Invoice #" DataField="InvoiceNumber">  
                        <HeaderStyle Width="85px"></HeaderStyle> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn UniqueName="AccountName" SortExpression="AccountName" HeaderText="Account Name" DataField="AccountName">  
                        <HeaderStyle /> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn UniqueName="TotalAmountDue" SortExpression="TotalAmountDue" HeaderText="Invoice Total" DataField="TotalAmountDue" DataFormatString="{0:C2}">  
                        <HeaderStyle Width="105px" HorizontalAlign="Right" /> 
                        <ItemStyle HorizontalAlign="Right" /> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn UniqueName="AmountOwed" SortExpression="AmountOwed" HeaderText="Balance Due" DataField="AmountOwed" DataFormatString="{0:C2}">  
                        <HeaderStyle Width="100px" HorizontalAlign="Right" /> 
                        <ItemStyle HorizontalAlign="Right" /> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn UniqueName="DateCreated" SortExpression="DateCreated" HeaderText="Created" DataField="DateCreated" DataFormatString="{0:d}">  
                        <HeaderStyle Width="68px"></HeaderStyle> 
                    </telerik:GridBoundColumn> 
                </Columns> 
            </MasterTableView> 
            <ClientSettings AllowDragToGroup="False" AllowGroupExpandCollapse="true" EnablePostBackOnRowClick="false">  
                <Selecting AllowRowSelect="True" /> 
                <Scrolling AllowScroll="True" UseStaticHeaders="True" /> 
            </ClientSettings> 
        </telerik:RadGrid> 
        <asp:HiddenField ID="FilterValue" runat="server" /> 
    </telerik:RadPane> 
    <telerik:RadSplitBar ID="RadSplitBar1" runat="server" CollapseMode="Backward" /> 
    <telerik:RadPane ID="InvoicePreviewRadPane" runat="server" Scrolling="Y">  
    </telerik:RadPane> 
</telerik:RadSplitter>   
 
 
 
    </div> 
    </form> 
</body> 
</html> 
 

Default.aspx.cs:

using System;  
using System.Web;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using System.Collections.Generic;  
using System.Data;  
using System.Configuration;  
using System.Web.Security;  
using System.Web.UI.WebControls.WebParts;  
using System.Web.UI.HtmlControls;  
using Telerik.Web.UI;  
 
public partial class Default : System.Web.UI.Page   
{  
    protected void Page_Load(object sender, EventArgs e)  
    {  
        List<Invoice> ds = new List<Invoice>();  
        ds.Add(new Invoice(Guid.NewGuid(), DateTime.Now, DateTime.Now, "12345""John Doe", 123.45M, 123.45M, DateTime.Now));  
 
        InvoiceGrid.DataSource = ds;  
        InvoiceGrid.DataBind();  
    }  
}  
 
public class Invoice  
{  
    private Guid id;  
    private DateTime invoiceDate;  
    private DateTime dueDate;  
    private string invoiceNumber;  
    private string accountName;  
    private decimal totalAmountDue;  
    private decimal amountOwed;  
    private DateTime dateCreated;  
 
    public Invoice(Guid id, DateTime invDate, DateTime dueDate, string invNo, string acctName, decimal total, decimal owed, DateTime created)  
    {  
        InvoiceDate = invDate;  
        DueDate = dueDate;  
        InvoiceNumber = invNo;  
        AccountName = acctName;  
        TotalAmountDue = total;  
        AmountOwed = owed;  
        DateCreated = created;  
    }  
 
    public Guid Id  
    {  
        get { return id; }  
        set { id = value; }  
    }  
 
    public DateTime InvoiceDate  
    {  
        get { return invoiceDate; }  
        set { invoiceDate = value; }  
    }  
 
    public DateTime DueDate  
    {  
        get { return dueDate; }  
        set { dueDate = value; }  
    }  
 
    public string InvoiceNumber  
    {  
        get { return invoiceNumber; }  
        set { invoiceNumber = value; }  
    }  
 
    public string AccountName  
    {  
        get { return accountName; }  
        set { accountName = value; }  
    }  
 
    public decimal TotalAmountDue  
    {  
        get { return totalAmountDue; }  
        set { totalAmountDue = value; }  
    }  
 
    public decimal AmountOwed  
    {  
        get { return amountOwed; }  
        set { amountOwed = value; }  
    }  
 
    public DateTime DateCreated  
    {  
        get { return dateCreated; }  
        set { dateCreated = value; }  
    }  

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 24 Jul 2009, 11:59 AM
Hello Scott,

Unfortunately, there is an issue with RadSplitters with Horizontal Orientation in the Q2 2009 release, which prevents some controls, including RadGrid, from adjusting their layout properly on initial load. Please use our latest internal build, which has this problem fixed. Sorry for the inconvenience.

http://www.telerik.com/account/downloads/internal-builds.aspx

Regards,
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
Scott R
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or