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

Height of grid header is not working.

3 Answers 125 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Minkyu Lee
Top achievements
Rank 1
Minkyu Lee asked on 02 Sep 2010, 03:40 AM
Hello,

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RadGrid.aspx.cs" Inherits="Test_RadGrid" %>
  
<%@ 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">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadGrid ID="RadGrid1" runat="server">
        <MasterTableView>
            <Columns>
                <telerik:GridBoundColumn DataField="AccountProgram" HeaderText="Account Program">
                    <HeaderStyle Width="150" Height="40"></HeaderStyle>
                </telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
    </form>
</body>
</html>

The Width of HeaderStyle is working. However, the Height of HeaderStyle is not working.

How can I do to solve this problem?

Thank you for your help.

Minkyu Lee.

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 02 Sep 2010, 08:23 AM
Hello Lee,

Try setting HeaderStyle-Height property of RadGrid and check whether it works.

ASPX:
<telerik:RadGrid ID="RadGrid1" runat="server" HeaderStyle-Height="40">

Thanks,
Princy.
0
Minkyu Lee
Top achievements
Rank 1
answered on 02 Sep 2010, 10:34 AM
Not working.  :(

My browser is IE8.
0
Dimo
Telerik team
answered on 02 Sep 2010, 11:14 AM
Hi Minkyu,

HeaderStyle-Height should work both on columns and on the MasterTableView. Here is a simple test page. Please check with Firebug whether the setting is applied and/or whether it is overridden.

Note that you can't set a smaller height than the content of the cell.

<%@ Page Language="C#" %>
<%@ Import Namespace="System.Data" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<script runat="server">
 
protected void RadGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
    DataTable dt = new DataTable();
    DataRow dr;
    int colsNum = 4;
    int rowsNum = 6;
    string colName = "Column";
 
    for (int j = 1; j <= colsNum; j++)
    {
        dt.Columns.Add(String.Format("{0}{1}", colName, j));
    }
 
    for (int i = 1; i <= rowsNum; i++)
    {
        dr = dt.NewRow();
 
        for (int k = 1; k <= colsNum; k++)
        {
            dr[String.Format("{0}{1}", colName, k)] = String.Format("{0}{1} Row{2}", colName, k, i);
        }
        dt.Rows.Add(dr);
    }
 
    (sender as RadGrid).DataSource = dt;
}
 
</script>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 
<head runat="server">
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<title>RadControls</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
 
<telerik:RadGrid
    ID="RadGrid1"
    runat="server"
    Skin="Office2007"
    OnNeedDataSource="RadGrid_NeedDataSource">
    <MasterTableView>
        <HeaderStyle Height="100px" />
    </MasterTableView>
</telerik:RadGrid>
 
</form>
</body>
</html>


Greetings,
Dimo
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
Minkyu Lee
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Minkyu Lee
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or