Adding and deleting rows

I have an sfDataGrid bound to an OleDb Table.
If I delete one or more row, and then I try to add a new one, whenever I click away to change the selected row I get an unhandled exception:

System.IndexOutOfRangeException: 'L'indice [idx] è negativo oppure superiore al totale delle righe.'
System.IndexOutOfRangeException
  HResult=0x80131508
  Messaggio=L'indice 12 è negativo oppure superiore al totale delle righe.
  Origine=System.Data
  Analisi dello stack:
   in System.Data.DataView.GetRow(Int32 index)
   in Syncfusion.Data.DataTableCollectionView.CommitNew()
   in Syncfusion.WinForms.DataGrid.GridAddNewRowController.CommitAddNew(Boolean changeState)
   in Syncfusion.WinForms.DataGrid.Interactivity.CurrentCellManager.SetCurrentCell(Int32 rowIndex, Int32 columnIndex)
   in Syncfusion.WinForms.DataGrid.Interactivity.CurrentCellManager.HandlePointerOperation(RowColumnIndex rowColumnIndex)
   in Syncfusion.WinForms.DataGrid.Interactivity.RowSelectionController.HandlePointerOperations(DataGridPointerEventArgs args, RowColumnIndex rowColumnIndex)
   in Syncfusion.WinForms.DataGrid.GridHandler.OnMouseUp(Object sender, MouseEventArgs e)
   in System.Windows.Forms.MouseEventHandler.Invoke(Object sender, MouseEventArgs e)
   in System.Windows.Forms.Control.OnMouseUp(MouseEventArgs e)
   in Syncfusion.WinForms.Controls.SfScrollControl.OnMouseUp(MouseEventArgs e)
   in System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   in System.Windows.Forms.Control.WndProc(Message& m)
   in Syncfusion.WinForms.Controls.SfScrollControl.WndProc(Message& msg)
   in System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   in System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   in System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   in System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   in System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   in System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   in System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   in System.Windows.Forms.Application.RunDialog(Form form)
   in System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   in IntegrazioneHRS.MainForm.btnParametriAzienda_Click(Object sender, EventArgs e) in C:\Users\bandi\Google Drive\HRS\Sviluppo\Sorgenti\IntegrazioneHRS V2\IntegrazioneHRS\MainForm.vb: riga 600
   in System.Windows.Forms.Control.OnClick(EventArgs e)
   in System.Windows.Forms.Button.OnClick(EventArgs e)
   in System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   in System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   in System.Windows.Forms.Control.WndProc(Message& m)
   in System.Windows.Forms.ButtonBase.WndProc(Message& m)
   in System.Windows.Forms.Button.WndProc(Message& m)
   in System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   in System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   in System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   in System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   in System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   in System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   in System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   in System.Windows.Forms.Application.RunDialog(Form form)
   in System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   in System.Windows.Forms.Form.ShowDialog()
   in IntegrazioneHRS.MainModule.Main() in xxx\MainModule.vb: riga 127

  Questa eccezione è stata generata in origine nello stack di chiamate seguente:
    System.Data.DataView.GetRow(int)
    Syncfusion.Data.DataTableCollectionView.CommitNew()
    Syncfusion.WinForms.DataGrid.GridAddNewRowController.CommitAddNew(bool)
    Syncfusion.WinForms.DataGrid.Interactivity.CurrentCellManager.SetCurrentCell(int, int)
    Syncfusion.WinForms.DataGrid.Interactivity.CurrentCellManager.HandlePointerOperation(Syncfusion.WinForms.GridCommon.ScrollAxis.RowColumnIndex)
    Syncfusion.WinForms.DataGrid.Interactivity.RowSelectionController.HandlePointerOperations(Syncfusion.WinForms.DataGrid.Events.DataGridPointerEventArgs, Syncfusion.WinForms.GridCommon.ScrollAxis.RowColumnIndex)
    Syncfusion.WinForms.DataGrid.GridHandler.OnMouseUp(object, System.Windows.Forms.MouseEventArgs)
    System.Windows.Forms.Control.OnMouseUp(System.Windows.Forms.MouseEventArgs)
    Syncfusion.WinForms.Controls.SfScrollControl.OnMouseUp(System.Windows.Forms.MouseEventArgs)
    ...
    [Stack di chiamate troncato]


11 Replies

SS Susmitha Sundar Syncfusion Team March 9, 2020 11:36 AM UTC

Hi Bandimon, 
 
Thank you for contacting Syncfusion support. 
 
We have checked your reported issue and unable to replicate the same from our end. We have checked with data table collection and adding by new row, we did not get any exception. it is working fine as expected. We have prepared the sample for the same, 
 
 
We have tested with Syncfusion update version 17.4.0.39. 
 
Please check the sample and let us know if you still facing the same issue? If not, please modify the sample based on your scenario and revert us back with the following details, 
 
·         SfDataGrid with data table configuration settings. 
·         Syncfusion update version. 
·          Issue reproducing video (if possible) 
 
It will be helpful for us to check on it and provide you the solution at the earliest.   
 
Regards,
Susmitha S
 



BA Bandimon March 11, 2020 02:34 PM UTC

Hello,

your application does not crash. I'll attach a new example, which is a stripped down part of my application.
If you delete a row and then add a new one, as soon as you will select a new row before saving you will get the Exception.

Regards,

Diego

Attachment: TestGrid_c8fad4ef.zip


SS Susmitha Sundar Syncfusion Team March 12, 2020 06:47 PM UTC

Hi Bandimon, 
 
Thanks for your update. 
 
We could able to reproduce your reported issue. Currently, we are analyzing the same. We will validate and update you details on or before March 16, 2020. 
 
We appreciate your patience until then. 
 
Regards, 
Susmitha S 



MA Mohanram Anbukkarasu Syncfusion Team March 16, 2020 01:35 PM UTC

Hi Bandimon, 

Thanks for your patience.  

We are able to reproduce the reported issue in our end and it is confirmed as a bug. We have logged a bug report on this regard. We will fix the issue and provide the patch for the fix in your version. Kindly confirm your Syncfusion product version. It will be helpful for us on the time of providing the patch. 


Regards, 
Mohanram A. 



BA Bandimon March 16, 2020 02:14 PM UTC

As requested, the version is the latest one from NuGet, 17.4.0.55


FP Farjana Parveen Ayubb Syncfusion Team March 17, 2020 05:25 AM UTC

Hi Bandimon, 
 
Thank you for your update. 
 
You have using the NuGet version, we will not provide the path for NuGet version. So, we will fix and include your reported issue in our 2020 Volume 1 main release, and it will be available on end of March 2020. We will let you know once it rolled out. 
 
We appreciate your patience until then. 
  
Regards, 
Farjana Parveen A 



BA Bandimon March 17, 2020 07:56 AM UTC

I will wait.

Thank you!


SS Susmitha Sundar Syncfusion Team March 18, 2020 05:03 AM UTC

Hi Bandimon,  
  
As we mentioned earlier, we will fix and include your reported issue in our 2020 Volume 1 main release. We will let you know once it rolled out.  
   
Regards,  
Susmitha S  



SS Susmitha Sundar Syncfusion Team April 3, 2020 05:55 AM UTC

Hi Bandimon, 
 
We are glad to announce that our Essential Studio 2020 Volume 1 Release v18.1.0.42 is rolled out with the reported bug fix “IndexOutOfRangeException occurs when selected row is deleted and new row is added through AddNewRow” and is available for download under the following link. 
 
 
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 
 
Regards, 
Susmitha S 



BA Bandimon April 3, 2020 06:54 AM UTC

Thank you very much. Your support is great !

Diego


SS Susmitha Sundar Syncfusion Team April 6, 2020 05:05 AM UTC

Hi Bandimon, 
 
Thanks for the update. 
 
We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help you. 
 
Regards, 
Susmitha S 


Loader.
Up arrow icon