Christopher
Top achievements
Rank 1
Christopher
asked on 20 Mar 2009, 03:09 PM
All I want to do is have a paragraph of text in a cell wrap. Why is this so hard with your grid control. Never before have I had so much trouble. I see the properties and options there (wordwrap, colwidth, rowheight, etc. etc. etc.). No matter what I do, nothing wraps.
4 Answers, 1 is accepted
0
Hello Christopher,
Thank you for your question.
Please set the WrapText property to each column. For instance:
Do not hesitate to write me back if you have further questions.
Sincerely yours,
Nick
the Telerik team
Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Thank you for your question.
Please set the WrapText property to each column. For instance:
private void Form1_Load(object sender, EventArgs e) |
{ |
this.radGridView1.Columns[0].WrapText = true; |
} |
Do not hesitate to write me back if you have further questions.
Sincerely yours,
Nick
the Telerik team
Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Barry Harkness
Top achievements
Rank 1
answered on 27 Jan 2010, 05:51 PM
Nick, how do you wrap text in a multi-row grid using an HtmlViewDefinition?
0
Hello Barry Harkness,
Thank you for contacting us. It is the same in both views but there is a bug so just setting a property to the column does not work as its value does not propagate properly to the cell. You can work-around the issue by manually setting the text wrapping to the cell in ViewCellFormatting:
The code above checks the column and propagates the text wrapping to the visual cell element.
We are going to fix the issue in our next official release (Q1 2010) expected at the beginning of March.
Greetings,
Nick
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Thank you for contacting us. It is the same in both views but there is a bug so just setting a property to the column does not work as its value does not propagate properly to the cell. You can work-around the issue by manually setting the text wrapping to the cell in ViewCellFormatting:
void
radGridView1_ViewCellFormatting(
object
sender, CellFormattingEventArgs e)
{
if
(e.CellElement.ColumnInfo.WrapText)
{
e.CellElement.TextWrap =
true
;
}
}
The code above checks the column and propagates the text wrapping to the visual cell element.
We are going to fix the issue in our next official release (Q1 2010) expected at the beginning of March.
Greetings,
Nick
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Hi Barry Harkness,
I created the work-around with our development version, but the property TextWrap is not exposed in Q3 2009 SP1 so here is another work-around (unfortunately there is more code now):
Best wishes,
Nick
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
I created the work-around with our development version, but the property TextWrap is not exposed in Q3 2009 SP1 so here is another work-around (unfortunately there is more code now):
void
radGridView1_CreateCell(
object
sender, GridViewCreateCellEventArgs e)
{
if
(e.CellType ==
typeof
(GridDataCellElement))
{
e.CellType =
typeof
(CustomDataCell);
}
}
public
class
CustomDataCell: GridDataCellElement
{
public
CustomDataCell(GridViewColumn column, GridRowElement row)
:
base
(column, row)
{
}
protected
override
Type ThemeEffectiveType
{
get
{
return
typeof
(GridDataCellElement);
}
}
public
override
StringFormat PaintTextFormat
{
get
{
StringFormat sf =
base
.PaintTextFormat;
sf.FormatFlags &= ~StringFormatFlags.NoWrap;
return
sf;
}
}
}
Best wishes,
Nick
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.