Extra Row After UserAddedRow

3 posts, 1 answers
  1. Akhil Raj
    Akhil Raj avatar
    69 posts
    Member since:
    Aug 2012

    Posted 27 Sep 2010 Link to this post

    hi all,
       I am showing records from databse in radgriview. The grid allow for insert, edit, delete etc. Frist time grid shows the records perfectly. When user added new row, i used  'UserAddingRow' event, pdate the new record into the table and bind the gridview with fresh records. Here Gridview showing one extra row in the bottom. How can i avoid that?

    When i trace the code and check after fix the datasource to the gridview, the source rows count and gridview's rows count are equal and correcly binding with new data. But in the display one more extra row displayed.

    Can anyone give a soultion for this. The make the interface bad...
  2. Answer
    Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 27 Sep 2010 Link to this post

    Hello Akhil,

    If you are handling the add row in the UserAddingEvent, you should call e.Cancel = true; in order to prevent the grid to create it's own row just like:

    void radGridView1__UserAddingRow(object sender, GridViewRowCancelEventArgs e)
    {
        e.Cancel = true;
     
        //handle custom logic and object creation here
    }

    Please let me know if you have any other question.

    Best Regards,
    Emanuel Varga
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Akhil Raj
    Akhil Raj avatar
    69 posts
    Member since:
    Aug 2012

    Posted 27 Sep 2010 Link to this post

    thanks friend. ya working nice
Back to Top