The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
After inserting a row in my databound grid I am trying to move the current cell back one line into the current cell. Although I am inserting a blank record into the data, after the current cell is moved, the data from the previous currentcell shows in my new currentcell. However, if I then move off the new currentcell and then back it shows up blank like it should. The code I''m using follows. How can I prevent this from happening?
Public Sub insertRow()
Dim row As Integer = m_grid.CurrentCell.RowIndex
Dim col As Integer = m_grid.CurrentCell.ColIndex
dtaProducts.GenProductsCollection.Insert(row - 1, New CGenProductsPricingInfo)
m_grid.CurrentCell.MoveTo(row, col)
End Sub
ADAdministrator Syncfusion Team October 14, 2004 03:14 PM UTC
You will not be able to insert rows into a datatable. You can only add them at the end using DataTable.AddNew.
If you need to rearrange the rows, then you can try to set up a DataView ordered on some hidden field that makes the rows appear in the order that you want them. But this will take some work to do.
JLJeff LancasterOctober 14, 2004 03:44 PM UTC
Actually, I am able to insert rows, as I am not bound to a datatable, I am bound to a custom collection implementing iBindingList. I have an insert function which works, it inserts a blank record and the grid is automatically syncing and properly showing the new blank record in the right row.
The problem is, when I use the CurrentCell.Moveto, so as to reposition the highlighter into the new row, it appears to be displaying the data from the old current cell in the new one. If I click off the new current cell and then back on it displays properly.
ADAdministrator Syncfusion Team October 14, 2004 05:07 PM UTC
Before you insert the row, try calling this.grid.CurrentCell.EndEdit() to see if this handles thie problem.