Home Forums WinForms controls Xceed Grid for WinForms Multiline edittable???

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #15817 |

    Hi

    Currently, text cell is singleline-eidt.
    I want to multiline-edit when to edit the text cell.
    How to do it??

    Imported from legacy forums. Posted by Lim (had 2038 views)

    Xceed Support
    Member
    Post count: 5658

    You need to set an WinTextBox (or any control) with MultiLine set to True and assign it to the CellViewerManager and the CellEditorManager. Also, if you set the AutoHeightMode to AllContent, it will adjust the row height after the end of the edition.

    <code>
    private void Form1_Load( object sender, EventArgs e )
    {
    Column col1 = new Column( “Column1” );
    Column col2 = new Column( “Column2” );
    gridControl1.Columns.Add( col1 );
    gridControl1.Columns.Add( col2 );

    for( int i = 0; i < 20; i++ )
    {
    Xceed.Grid.DataRow row = gridControl1.DataRows.AddNew();
    row.Cells[ “Column1” ].Value = “Item ” + i.ToString();
    row.Cells[ “Column2” ].Value = “MultiLine\r\nText\r\nCan\r\nBe Displayed”;

    row.EndEdit();
    }

    WinTextBox box = new WinTextBox( EnhancedBorderStyle.None );
    box.TextBoxArea.Multiline = true;
    gridControl1.Columns[ 1 ].CellViewerManager = new TextViewer( box );
    gridControl1.Columns[ 1 ].CellEditorManager = new TextEditor( box );

    dataRowTemplate1.AutoHeightMode = AutoHeightMode.AllContent;
    }
    </code>

    Imported from legacy forums. Posted by CharlesB (had 3022 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.