How to set the row height of RadGrid

2 posts, 0 answers
  1. Saikiran
    Saikiran avatar
    8 posts
    Member since:
    Jul 2014

    Posted 31 Jul 2014 Link to this post

    Hi 

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

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 31 Jul 2014 in reply to Saikiran Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top