Under VFP 9 I have a data grid linked to a table of line items for a sales
order.

Whenever I go to use the GRID.ActiveRow property it returns a number 1
greater than the number of order item records being displayed (filtered); no
matter which row is highlighted or which row is active - e.g. 3 order item
records ActiveRow returns 4 no matter which row is selected.

ActiveColumn is returning the correct value.

Any ideas as to what is causing this.

What I am trying to do is automatically add a new record when the user is
positioned on the last record and last column and presses Enter, instead of
having them click a button to add the line.

--
Regards

Bob B.

RE: Grid.ActiveRow problems by Leemi

Leemi
Wed Oct 25 10:57:35 CDT 2006

Hi Bob:

Since you are trying to add records to a grid, take a look at this article
before we get into the other stuff:

138559 How to Append Records to a Grid
http://support.microsoft.com/default.aspx?scid=kb;EN-US;138559

This example might give you just what you need using a different technique.

I hope this helps.

This posting is provided "AS IS" with no warranties, and confers no rights.

Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell

*-- VFP9 HAS ARRIVED!! --*
Read about all the new features of VFP9 here:
http://msdn.microsoft.com/vfoxpro/

*--Purchase VFP 9.0 here:
http://www.microsoft.com/PRODUCTS/info/product.aspx?view=22&pcid=54787e64-52
69-4500-8bf2-3f06689f4ab3&type=ovr

Keep an eye on the product lifecycle for Visual FoxPro here:
http://support.microsoft.com/gp/lifeselectindex
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retired Sept. 30th, 2003


>Under VFP 9 I have a data grid linked to a table of line items for a sales
>order.

>Whenever I go to use the GRID.ActiveRow property it returns a number 1
>greater than the number of order item records being displayed (filtered);
no
>matter which row is highlighted or which row is active - e.g. 3 order item
>records ActiveRow returns 4 no matter which row is selected.

>ActiveColumn is returning the correct value.

>Any ideas as to what is causing this.

>What I am trying to do is automatically add a new record when the user is
>positioned on the last record and last column and presses Enter, instead
of
>having them click a button to add the line.

>--
>Regards

>Bob B.



RE: Grid.ActiveRow problems by Bob

Bob
Wed Oct 25 11:37:02 CDT 2006

Lee,

I will look through the code given on the MS support site you gave.

At the moment I cannot get it to work. But at least it gives me a few ideas.

I got the ActiveRow property to return the correct value on a Click event of
a cell.
I was using the Keypress event to try and get its value which did not succeed.

Thanks for the pointers.


--
Regards

Bob B.


"Lee Mitchell" wrote:

> Hi Bob:
>
> Since you are trying to add records to a grid, take a look at this article
> before we get into the other stuff:
>
> 138559 How to Append Records to a Grid
> http://support.microsoft.com/default.aspx?scid=kb;EN-US;138559
>
> This example might give you just what you need using a different technique.
>
> I hope this helps.
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> Sincerely,
> Microsoft FoxPro Technical Support
> Lee Mitchell
>
> *-- VFP9 HAS ARRIVED!! --*
> Read about all the new features of VFP9 here:
> http://msdn.microsoft.com/vfoxpro/
>
> *--Purchase VFP 9.0 here:
> http://www.microsoft.com/PRODUCTS/info/product.aspx?view=22&pcid=54787e64-52
> 69-4500-8bf2-3f06689f4ab3&type=ovr
>
> Keep an eye on the product lifecycle for Visual FoxPro here:
> http://support.microsoft.com/gp/lifeselectindex
> - VFP5 Mainstream Support retired June 30th, 2003
> - VFP6 Mainstream Support retired Sept. 30th, 2003
>
>
> >Under VFP 9 I have a data grid linked to a table of line items for a sales
> >order.
>
> >Whenever I go to use the GRID.ActiveRow property it returns a number 1
> >greater than the number of order item records being displayed (filtered);
> no
> >matter which row is highlighted or which row is active - e.g. 3 order item
> >records ActiveRow returns 4 no matter which row is selected.
>
> >ActiveColumn is returning the correct value.
>
> >Any ideas as to what is causing this.
>
> >What I am trying to do is automatically add a new record when the user is
> >positioned on the last record and last column and presses Enter, instead
> of
> >having them click a button to add the line.
>
> >--
> >Regards
>
> >Bob B.
>
>
>

Re: Grid.ActiveRow problems by AA

AA
Wed Oct 25 11:00:46 CDT 2006

I seem to remember that ActiveRow can only be read when the grid has focus.
-Anders

"Bob" <Bob@discussions.microsoft.com> skrev i meddelandet
news:4D121B02-A415-40DB-A830-C39ADD2CDEFE@microsoft.com...
> Under VFP 9 I have a data grid linked to a table of line items for a sales
> order.
>
> Whenever I go to use the GRID.ActiveRow property it returns a number 1
> greater than the number of order item records being displayed (filtered);
> no
> matter which row is highlighted or which row is active - e.g. 3 order item
> records ActiveRow returns 4 no matter which row is selected.
>
> ActiveColumn is returning the correct value.
>
> Any ideas as to what is causing this.
>
> What I am trying to do is automatically add a new record when the user is
> positioned on the last record and last column and presses Enter, instead
> of
> having them click a button to add the line.
>
> --
> Regards
>
> Bob B.