Binding a grid control


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Binding a grid control

Hybrid View

  1. #1
    Craigw Guest

    Binding a grid control


    Hello everyone,

    I am old to FoxPro, new to VFP 6.0. I receive an error that my grid control
    cannot find the alias to which is bound. My grid works fine when I include
    this table in my dataenvironment, however, this table needs to be created
    at run time. Can I still include it in my dataenvironment? help!

  2. #2
    Garrett Fitzgerald Guest

    Re: Binding a grid control

    In article <38fbc7a1$1@news.devx.com>, mycraig@msn.com says...
    > I receive an error that my grid control
    > cannot find the alias to which is bound. My grid works fine when I include
    > this table in my dataenvironment, however, this table needs to be created
    > at run time. Can I still include it in my dataenvironment? help!


    No: just bind the grid to the table after you create the table. You'll
    lose any custom field settings you do at design time, though... Do you
    have to create the table at run-time, or can you use a view for the
    RecordSource?
    --
    #INCLUDE "\Program Files\Microsoft Visual Studio\VFP98\StdDsclm.h"
    (Anyone who thinks that I do anything vaguely resembling speaking
    for Microsoft is sorely deluded...)

  3. #3
    Anders Altberg Guest

    Re: Binding a grid control

    Hi
    Unless you really absolutely need a table, you can create a view of a table
    and use it as RecordSource of a grid control. The view cursor can be made
    updateable so you can insert and modify records and transfer the changes to
    the table behind the view when you like.
    -Anders

    "Craigw" <mycraig@msn.com> wrote in message news:38fbc7a1$1@news.devx.com...
    >
    > Hello everyone,
    >
    > I am old to FoxPro, new to VFP 6.0. I receive an error that my grid

    control
    > cannot find the alias to which is bound. My grid works fine when I

    include
    > this table in my dataenvironment, however, this table needs to be created
    > at run time. Can I still include it in my dataenvironment? help!




  4. #4
    William Fields Guest

    Re: Binding a grid control

    If you can create the table in the load event of the form, you're good to
    go. Otherwise, you'll have to do some programmatic building of the grid
    after the recordsource is available.

    --
    William Fields
    MCP - Microsoft Visual FoxPro
    US Bankruptcy Court
    Phoenix, AZ


    "Craigw" <mycraig@msn.com> wrote in message news:38fbc7a1$1@news.devx.com...
    >
    > Hello everyone,
    >
    > I am old to FoxPro, new to VFP 6.0. I receive an error that my grid

    control
    > cannot find the alias to which is bound. My grid works fine when I

    include
    > this table in my dataenvironment, however, this table needs to be created
    > at run time. Can I still include it in my dataenvironment? help!




  5. #5
    David Frankenbach Guest

    Re: Binding a grid control

    Craig,

    You can create the table/cursor in the Load() event of the form, that way it
    will be available for the Grid to bind to when it instantiates.
    --
    df - (Microsoft FoxPro MVP) http://www.geocities.com/df_FoxPro/

    "Craigw" <mycraig@msn.com> wrote in message news:38fbc7a1$1@news.devx.com...
    >
    > Hello everyone,
    >
    > I am old to FoxPro, new to VFP 6.0. I receive an error that my grid

    control
    > cannot find the alias to which is bound. My grid works fine when I

    include
    > this table in my dataenvironment, however, this table needs to be created
    > at run time. Can I still include it in my dataenvironment? help!




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center