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. Image for the cookie policy date

"there is no row at position 57" while changing row 2???

My app reads from a single oracle table, through oledb, to GridDataBoundGrids, using binding. If the dataset gets refilled and has fewer rows as a result, I get exceptions reading: "There is no row at position <>" where the position number is the previous number of rows in the dataset. This error arises in code where I''m iterating the rows and columns, and changing the "readonly" attribute, and the showbuttons attribute. The error arises whenever it call the function,even if I''m changing a row that still exists.

4 Replies

AD Administrator Syncfusion Team August 2, 2004 08:51 AM

Before you refill your data source, try setting grid.CurrentCell.MoveTo(1,1) to see if this handles this problem. You can also reset the CurrencyManager Psoition as in this.grid.BindingContext[this.grid.DataSource, this.grid.DataMember].Position = -1; to see if that will handle things.


JA James A Frisby(For EPS - Computer Software) August 2, 2004 10:12 AM

Clay, Setting the currentcell.moveto didn''t help, however, I can test the flag e.g. readonly using the row,column, then change only if it''s not what i want. I find it strange that changing row 1 column 1 cauess an exception on the last row in the control, but referencing the value you are about to change doesn''t cause the exception. I could not find the BindingContext member of GridDataBoundGrid. (I''m using VB). Jim Frisby >Before you refill your data source, try setting grid.CurrentCell.MoveTo(1,1) to see if this handles this problem. > >You can also reset the CurrencyManager Psoition as in > >this.grid.BindingContext[this.grid.DataSource, this.grid.DataMember].Position = -1; > > >to see if that will handle things.


AD Administrator Syncfusion Team August 2, 2004 10:24 AM

The BindingControl propery is a Control.BindingContext property, so it should be accepted syntax wise. It may be that this property is marked Advanced, so VB may hide it in intellisense, but you should be able to use it. It is there.


JA James A Frisby(For EPS - Computer Software) August 2, 2004 11:08 AM

Clay, I was alble to invoke the method, however, calling both that and calling the moveto(1,1) before refilling the data source had no effect on the "no row at position" problem. I was able to get around the problem however, by testing the property before I change it, and changing it only if it''s wrong. Whatever is causing the exception doesn''t fire unless you change the value,reading the value does not raise the exception. In my case, I only change the grid for data that exists, so if i test first, and only cover the rows that exist, it doesn''t have to change them again unless the new dataset is bigger than any encountered so far. If the new dataset is bigger, there is a row at every position, so the problem doesn''t happen. >The BindingControl propery is a Control.BindingContext property, so it should be accepted syntax wise. It may be that this property is marked Advanced, so VB may hide it in intellisense, but you should be able to use it. It is there.

Loader.
Live Chat Icon For mobile
Up arrow icon