Home Forums WinForms controls Xceed Grid for WinForms Add New Row – Urgent

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

    I am using xceed grid for .Net and I have found that to add new row to the grid you need to click on line above it or press enter to commit the changes.

    Is there any other alternative?

    Waiting for you reply.

    Thanks in advance.

    Imported from legacy forums. Posted by sumera (had 1955 views)

    Xceed Support
    Member
    Post count: 5658

    I think you are referring to the InsertionRow. However, the main way to add a row to an unbound grid is to use the AddNew() method from the DataRows collection.

    Here is some sample code:

    <code>
    for( int j = 0; j < 4; j++ )
    {
    Column col = new Column( “Column”+j.ToString() );
    gridControl1.Columns.Add( col );
    }

    for( int i = 0; i < 20; i++ )
    {
    Xceed.Grid.DataRow row = gridControl1.DataRows.AddNew();
    foreach( Cell cell in row.Cells )
    {
    cell.Value = “Item ” + i.ToString();
    }
    row.EndEdit();
    }
    </code>

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

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