Wrap text on a cell on radgridview

5 posts, 0 answers
  1. ISB-developer
    ISB-developer avatar
    21 posts
    Member since:
    Jul 2011

    Posted 18 Oct 2011 Link to this post

    Hi,
    Where is the setting in radgridview for wrapping the text inside of the cells?
  2. Alexander
    Admin
    Alexander avatar
    306 posts

    Posted 20 Oct 2011 Link to this post

    Hello,

    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.

  3. UI for WinForms is Visual Studio 2017 Ready
  4. Rawad
    Rawad avatar
    23 posts
    Member since:
    Jan 2012

    Posted 26 Jun 2014 in reply to Alexander Link to this post

    Dear Alexander

    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
  5. Rawad
    Rawad avatar
    23 posts
    Member since:
    Jan 2012

    Posted 26 Jun 2014 in reply to Alexander Link to this post

    Dear Alexander

    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
  6. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 26 Jun 2014 Link to this post

    Hi Rawad,

    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
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top
UI for WinForms is Visual Studio 2017 Ready