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

Specific Row Height

5 Answers 94 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jebamalai
Top achievements
Rank 1
Jebamalai asked on 01 Oct 2008, 12:13 PM
Dear All,

How to specify the row height of the grid.

Is there any way to make the row height fixed.

Or else it can be changed dynamically in code or design.

Can any one let me know the possibility of it?

Thanks a lot in advance.

5 Answers, 1 is accepted

Sort by
0
Demon
Top achievements
Rank 1
answered on 01 Oct 2008, 12:23 PM
You can use

<ItemStyle Height="...." />
<AlternatingItemStyle Height="...." />

However, table cells always expand vertically if the content inside is higher than the specified height, so a fixed height is not supported in all scenarios.

As an alternative, you can use a template column with a <div> element inside each table cell. Then you can set a height style and overflow:hidden (or overflow:auto) to this <div>

Regards.
0
Accepted
Princy
Top achievements
Rank 2
answered on 01 Oct 2008, 01:18 PM
Hello Jebamalai,

You can use the following code if you have specified some skin for the grid to set the row height.
css.styles:
<head runat="server"
    <title>Untitled Page</title> 
    <style type="text/css"
 
    .GridRow_[SkinName] td 
    { 
     height:200px; 
    }         
    </style>    
</head> 

Thanks
Princy.
0
Jebamalai
Top achievements
Rank 1
answered on 01 Oct 2008, 01:31 PM
Dear Princy,

Thanks for your reply.

How can I do this in code?
0
Accepted
Princy
Top achievements
Rank 2
answered on 01 Oct 2008, 01:37 PM
Hello Jebamalai,

You can try out the following code to set the row height.
cs:
 protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridDataItem) 
        { 
            GridDataItem item =(GridDataItem)e.Item;             
            item.Style.Add("height", "50px");       
        } 
    } 

Thanks
Princy.
0
Jebamalai
Top achievements
Rank 1
answered on 03 Oct 2008, 05:22 AM
Dear Princy,

Thank you very much for the timely help.

It will really help me a lot.

Thanks once again.


Tags
Grid
Asked by
Jebamalai
Top achievements
Rank 1
Answers by
Demon
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Jebamalai
Top achievements
Rank 1
Share this question
or