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

Adjust cells height

6 Answers 133 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Patxi
Top achievements
Rank 1
Patxi asked on 30 Mar 2009, 03:04 PM
Hello,

I would like to adjust as much as possible cells height. How can I do this?

Thank you.

6 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 31 Mar 2009, 05:24 AM
Hi,

Give a try with the following code snippet and see whether it helps.

CS:
 
 protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    { 
        if (e.Item is GridDataItem) 
        { 
            GridDataItem item = (GridDataItem)e.Item; 
            TableCell cell = (TableCell)item["ProductName"]; 
            cell.Height = Unit.Pixel(100); 
        } 
      
    } 
 


Thanks
Shinu
0
Patxi
Top achievements
Rank 1
answered on 31 Mar 2009, 07:33 AM
Hi Shinu,

thanks for your reply.

I have used your code and is not taking effects. The problem is that I am using a checkbox in the first column of every row, so I´m not sure whether this is producing any problem to fix cells height. I have used a high value for cells (50px for example) and it works ok.

Do you know whether checkboxes are altering heights?

Thank you.
0
Patxi
Top achievements
Rank 1
answered on 01 Apr 2009, 10:46 AM
nobody knows? :(
0
Brad
Top achievements
Rank 2
answered on 07 Apr 2009, 06:30 PM
I'm having trouble as well trying to get a cell height to be smaller. No matter what I set it never seems to go below 20 or so pixels. I'm wasting a lot of space and when I put the grid next to a couple of charts it makes the table it's in too long for the charts so it looks pretty stupid. Especially because there is so much unused space in the cell. Any ideas on how to get cell heights down to 10 or so pixels?

Thanks,

Joe B
0
Yavor
Telerik team
answered on 08 Apr 2009, 06:37 AM
Hello Joe,

Please, make sure that there are not other settings which prevent the cell from reducing its dimensions. These may be font size, as well as padding.

Regards,
Yavor
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Patxi
Top achievements
Rank 1
answered on 08 Apr 2009, 07:19 AM
Hello Joe and Yavor,

Few days ago I got to adjust cells height. I found an interesting post in this forum.

Here you have the link:
   Adjust cells

If you have any problem, feel free to ask. It´s a very nice example, so I suppose you won´t have any problem.

Regards,
Aitor.
Tags
Grid
Asked by
Patxi
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Patxi
Top achievements
Rank 1
Brad
Top achievements
Rank 2
Yavor
Telerik team
Share this question
or