This is a migrated thread and some comments may be shown as answers.

Extra Row After UserAddedRow

2 Answers 78 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Akhil Raj
Top achievements
Rank 1
Akhil Raj asked on 27 Sep 2010, 12:02 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Emanuel Varga
Top achievements
Rank 1
answered on 27 Sep 2010, 12:25 PM
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
0
Akhil Raj
Top achievements
Rank 1
answered on 27 Sep 2010, 01:12 PM
thanks friend. ya working nice
Tags
GridView
Asked by
Akhil Raj
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
Akhil Raj
Top achievements
Rank 1
Share this question
or