Completed
Last Updated: 25 May 2016 14:25 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 18 May 2016 08:26
Category: GridView
Type: Bug Report
0
FIX. RadGridView - TextWrap doesn't work for group cells
To reproduce:

private void Form1_Load(object sender, EventArgs e)
{
    this.productsTableAdapter.Fill(this.nwindDataSet.Products);
    this.radGridView1.BestFitColumns(BestFitColumnMode.AllCells);
}

private void radGridView1_ViewCellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e)
{
    if (e.CellElement is GridGroupContentCellElement)
    {
        e.CellElement.TextWrap = true;
    }
    else
    {
        e.CellElement.ResetValue(LightVisualElement.TextWrapProperty, ValueResetFlags.Local);
    }
}

Workaround: set the AutoSizeColumnsMode property to GridViewAutoSizeColumnsMode.Fill and use the ViewCellFormatting event to wrap the text: 

private void radGridView1_ViewCellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e)
{
    if (e.CellElement is GridGroupContentCellElement)
    {
        e.CellElement.TextWrap = true;
    }
    else
    {
        e.CellElement.ResetValue(LightVisualElement.TextWrapProperty, ValueResetFlags.Local);
    }
}
Attached Files:
0 comments