We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

"Error when commiting the row to the original data store"

Thread ID:

Created:

Updated:

Platform:

Replies:

4555 May 19,2003 05:08 AM UTC Sep 21,2004 10:50 AM UTC Windows Forms 2
loading
Tags: FAQ
Hubert Galuszka
Asked On May 19, 2003 05:08 AM UTC

Hi! I have written my own datagridcolumn style. Its functionality is to show an userControl when user wants to edit field in dg. the control works fine, opens proper row, saves changed values in proper fields etc. The only problem is commiting value: when dg tries to commit value, I get following message: "Error when commiting the row to the original data store. Index -1 is not non-negative and below total rows count. Do you want to correct the value? (yes/no)". When I agree, fields are made value 0. When I disagree, exception is thrown: System.IndexOutOfRangeException: Index -1 is not non-negative and below total rows count. at System.Data.DataView.GetElement(Int32 index) at System.Data.DataView.System.Collections.IList.get_Item(Int32 recordIndex) at System.Windows.Forms.CurrencyManager.CancelCurrentEdit() at System.Windows.Forms.DataGrid.HandleEndCurrentEdit() at System.Windows.Forms.DataGrid.OnLeave_Grid() at System.Windows.Forms.Control.InvokeMarshaledCallbacks() I have no idea why index gets negative value? what to do? any ideas? sorry for so long post - i'm getting desperate ;-) thanks for your time h.

Administrator [Syncfusion]
Replied On November 11, 2003 11:38 AM UTC

> Hi! > I have written my own datagridcolumn style. Its functionality is to show an userControl when user wants to edit field in dg. the control works fine, opens proper row, saves changed values in proper fields etc. The only problem is commiting value: when dg tries to commit value, I get following message: "Error when commiting the row to the original data store. Index -1 is not non-negative and below total rows count. Do you want to correct the value? (yes/no)". When I agree, fields are made value 0. When I disagree, exception is thrown: > > System.IndexOutOfRangeException: Index -1 is not non-negative and below total rows count. > at System.Data.DataView.GetElement(Int32 index) > at System.Data.DataView.System.Collections.IList.get_Item(Int32 recordIndex) > at System.Windows.Forms.CurrencyManager.CancelCurrentEdit() > at System.Windows.Forms.DataGrid.HandleEndCurrentEdit() > at System.Windows.Forms.DataGrid.OnLeave_Grid() > at System.Windows.Forms.Control.InvokeMarshaledCallbacks() > > > I have no idea why index gets negative value? what to do? > any ideas? > sorry for so long post - i'm getting desperate ;-) > thanks for your time > h. >

Administrator [Syncfusion]
Replied On September 21, 2004 10:50 AM UTC

Set "DataGrid.SelectedIndex = -1". I think it will solve your problem.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;