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.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

17129 Aug 2,2004 08:20 AM Aug 2,2004 12:08 PM Windows Forms 4
loading
Tags: GridControl
James A Frisby(For EPS - Computer Software)
Asked On August 2, 2004 08:20 AM

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.

Administrator [Syncfusion]
Replied On August 2, 2004 09: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.

James A Frisby(For EPS - Computer Software)
Replied On August 2, 2004 11: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.

Administrator [Syncfusion]
Replied On August 2, 2004 11: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.

James A Frisby(For EPS - Computer Software)
Replied On August 2, 2004 12:08 PM

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.

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.

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.

;