Skip to content

Problem - Inserting new record in a GridView at certain position, after a certain row

Nel

Asked May 16, 2011, 4:39 AM EDT2 answers
Share
LinkedInX

Hi,

Could anybody help me how to insert a new record in a Grid View after a certain row not at the bottom of the GridView. I would like to update the state of the counter (identity type) of the row as to remain in ascending order again after inserting the new row?

Thank you in advance.

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    After the new row is added, rebind the datasource to gridview. On the datasource you can do order by also.
    0
  • 0
    Thanks, but when I add the new record it gets the row number automatically increased by one comparing to the last inserted (the column has type identity), not a number that follows the record where it should be inserted. So when I sort the table it will remain at the same position. I want all the records that should follow the inserted one, to get a new ordering number increased by one. In fact the whole table to be ordered again.
    0