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

How to set the row height of RadGrid

1 Answer 363 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Saikiran
Top achievements
Rank 1
Saikiran asked on 31 Jul 2014, 06:15 AM
Hi 

Please let me know How to set the row height of RadGrid  

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 31 Jul 2014, 06:42 AM
Hi Saikiran,

Please have a look into the following complete sample code I tried for your requirement.

ASPX:
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<telerik:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid_NeedDataSource">
    <MasterTableView>
        <ItemStyle CssClass="item-style" />
        <AlternatingItemStyle CssClass="item-style" />
    </MasterTableView>
</telerik:RadGrid>

CSS:
<style type="text/css">
    .RadGrid tr.item-style
    {
        background: yellow;
    }
         
    .RadGrid .item-style td
    {
        padding-top: 0;
        padding-bottom: 0;
        height: 150px;
        vertical-align: middle;
    }
</style>

C#:
protected void RadGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
    DataTable table = new DataTable();
    table.Columns.Add("ID");
    table.Columns.Add("Name");
    table.Rows.Add(new object[] { "1", "John" });
    table.Rows.Add(new object[] { "2", "Antony" });
    table.Rows.Add(new object[] { "3", "James" });
    table.Rows.Add(new object[] { "4", "Jim" });
    RadGrid1.DataSource = table;
}

Thanks,
Shinu.
Tags
Chart (HTML5)
Asked by
Saikiran
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Share this question
or