Results 1 to 4 of 4

Thread: Typed Dataset and Bound Controls

  1. #1

    Thread Starter
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Typed Dataset and Bound Controls

    I have a typed data that I've created that links the table 'Contacts' to the table 'Clubs' via a table called 'ClubContacts' - e.g. there's a relation between 'Contacts' & 'ClubContacts', and a relation between 'Clubs' & 'ClubContacts'

    On my form there is a bound grid for the 'Clubs' table and a bound grid for the 'Contacts' table. What I want is for the contents of the 'Contacts' grid to update dependent on the current record in the 'Clubs' grid. I figure there must be a way to get the dataset to drive this behaviour, but I can't work it out.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,350

    Re: Typed Dataset and Bound Controls

    Follow the CodeBank link in my signature and check out my thread on Master/Detail Data-binding. I've never tried to do it with a join table like that but it may be possible. You'd have to use three BindingSources with just two of them bound to your grids.

  3. #3

    Thread Starter
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: Typed Dataset and Bound Controls

    Cheers jmcilhinney, that's definitely put me a step in the right direction, and after tweaking my relationships in the dataset designer, I've got my three BindingSources connected to each other.

    However, the resulting behaviour isn't quite what I was aiming for. The last BindingSource only shows data related to the selected record in the middle BindingSource, rather than all the records (which makes sense, because that's the desired behaviour between the first and middle BindingSources).

    Can that be altered?

    Or am I just better off building a view into my dataset that already does the join between two of the tables?

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,350

    Re: Typed Dataset and Bound Controls

    I was not certain that the three BindingSources would work and it appears that perhaps it won't. You may need to add some manual filtering.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width