Where is the setting in radgridview for wrapping the text inside of the cells?
8 Answers, 1 is accepted
Thank you for your question.
The WrapText is a property of GridViewColumn:
this
.radGridView1.Columns[0].WrapText =
true
;
Please review this help article for more details concerning RadGridView columns.
I hope it helps.
Best regards,
Alexander
the Telerik team
Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.
Can I wrapText specific cells and not the column, the posted above shows how to Wrap a column.
What I need is to wrapText of specific cells or rows
In Microsoft Grid, we used: Gridview.rows(1).cells(1).Style.WrapMode = DataGridViewTriState.True
Thanks
The posted above shows how to WrapText a column.
Could we WrapText a specific Cell ?
In Microsoft Grid, we use Gridview.Rows(1).Cells(1).Style.WrapMode=DataGridViewTriState.True
Thanks
Thank you for writing.
You can use the CellFormatting event do achieve the desired functionality. Here is also a small sample:
void
radGridView1_CellFormatting(
object
sender, CellFormattingEventArgs e)
{
if
(e.RowIndex == 1 && e.ColumnIndex == 1)
{
e.CellElement.TextWrap =
true
;
}
else
{
e.CellElement.ResetValue(LightVisualElement.TextWrapProperty, ValueResetFlags.Local);
}
}
I hope this helps.
Regards,
Stefan
Telerik
Hi,
I too facing the same issue. while exporting the data from grid to excel i am using the below code...
Dim spreadExporter As Telerik.WinControls.Export.GridViewSpreadExport = New Telerik.WinControls.Export.GridViewSpreadExport(griddata)
...............
spreadExporter.ExportHierarchy = True
spreadExporter.ExportVisualSettings = True
If the column data is more i am not able to export. it is showing the error "code--2146233086:columnWidth should be greater or equal than 0 and less or equal than 2000."
But if "spreadExporter.ExportVisualSettings = False" able to export but the excel format getting disturbed.
Please suggest.
This seems to be a known issue and it is already logged in our Feedback Portal. The issue is fixed in the latest version. A workaround for previous versions is available here: UI for Winforms Feedback Portal - FIX. RadGridView - exception, when the grid has a column wider than 2000 and the grid, is exported.
I hope this will be useful.
Regards,
Dimitar
Progress Telerik
Hi,
Thanks for your above help .I use below code to fix the Grid Width and able to fix it.
For Each col As GridViewDataColumn In gridview.Columns
Dim xc As Integer = col.Index
Dim
xcx As Double = col.Width
If (xcx
> 2000) Then
col.Width = 2000
Dim vvv As String = col.WrapText
.....
But now I am getting Error of height "-2146233086-rowHeight
should be greater or equal than 0 and less or equal than 600." I try to
implement the same logic but in a single row each cell row height is different.
And I am not able to track each cell row height. Only I am getting the standard
row height. Please help to fix it .
For the row height, you can override the SetWorksheetRowHeight method and use the same approach.
Let me know how this works for you.
Regards,
Dimitar
Progress Telerik