Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1965
Displaying the newly added row on the top of the grid upon row adding event
posted

Hi All,

I am facing an issue in row adding event.

Upon new row addition,

  • If the grid is not sorted, then the newly added record gets added to the end of the grid.
  • If the grid is sorted, then the newly added record gets added in the middle of the grid according to the sort order.

Kindly provide a solution to display the newly added record on the top of the grid in the 1st page or highlight the same.

Thanks,

Parthiban

  • 280
    Suggested Answer
    posted

    Hello,

    i m using ultra grid view instead of grid view
    A possible approach to achieve this might be by using the following code:

    Dim row As UltraGridRow = Me.UltraGrid1.DisplayLayout.Bands(0).AddNew()
    row.ParentCollection.Move(row, 0)

    if U need more help please contact me at below link

    http://ahmadkhalid44.blogspot.com/

    Regards:

    Ahmad Khalid

    Software ENGINEER

    Saood Software Solution

  • 10685
    Offline posted

    Hello,

    Basically you could consider using BatchUpdating as in this case the new rows will always appear at the bottom of the grid, while there is PostBack to the Server. After PostBack, the records will be displayed in their correct position in the grid, depending on the sorting applied. Hope this is useful in your application.