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

[Solved] How ca i set the row heigth dynamicly

4 Answers 117 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Christian
Top achievements
Rank 1
Christian asked on 14 May 2009, 02:46 PM
How can I set the row heigth in a radGrid dynamicly, so that long terms  also can be seen?

Thanks

Christian

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 15 May 2009, 06:33 AM
Hello Christian,

By setting the property Wrap="True" for the particular row Itemstyle will wrap the column cell's content if it is too long and auto-adjust the height of row.
ASPX:
 
<telerik:GridBoundColumn DataField="CompanyName" HeaderText="CompanyName" SortExpression="CompanyName" 
    UniqueName="CompanyName"
    <ItemStyle Wrap="true" Width="50px"/> 
</telerik:GridBoundColumn> 

If you want to set the height of row to desired in code behind, then you can try the following code snippet as well.
CS:
 
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    if(e.Item is GridDataItem) 
    { 
        GridDataItem item = (GridDataItem)e.Item; 
        item.Height = Unit.Pixel(50); 
    } 

Thanks,
Shinu.
0
Christian
Top achievements
Rank 1
answered on 15 May 2009, 06:53 AM
I have triied wrap = true but it doesn't work:

                boundColumn = New GridBoundColumn  
                boundColumn.DataField = "WERT_ALT" 
                boundColumn.UniqueName = "WERT_ALT" 
                boundColumn.HeaderStyle.Width = Unit.Pixel(180)  
                boundColumn.ItemStyle.Wrap = True 
                g.MasterTableView.Columns.Add(boundColumn) 

Christian
0
Christian
Top achievements
Rank 1
answered on 26 May 2009, 08:54 AM
has someone  a solution?

Christian
0
Accepted
Princy
Top achievements
Rank 2
answered on 26 May 2009, 09:52 AM
Hello Christian,

If your cell content is long enough and there are no empty spaces whithin the text then the text can break the cells and can appear outside the cell border. This is truly browser behavior and is found to happen with all browsers except IE . A possible solution is to try setting the TableLayout property of the MasterTableView to Fixed . This should enable long text to be clipped even if there are no empty spaces within the text.

Thanks
Princy.
Tags
Grid
Asked by
Christian
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Christian
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or