CodeSmith Community
Your Code. Your Way. Faster!

ManyToManyListRelationship with filtered Reference Members

Latest post 12-04-2007 11:36 PM by roonz. 3 replies.
  • 03-26-2007 10:25 PM

    • velum
    • Top 25 Contributor
    • Joined on 07-14-2006
    • Montréal, Qc, Canada
    • Posts 186
    • Points 4,686

    ManyToManyListRelationship with filtered Reference Members

    Hi! 

    I have a ManyToManyListRelationship with a Reference Member bound to a DataSource (GroupeDataSource) that can be filtered. The ListControl is a CheckBoxList. When the DataSource is not filtered (Select All Groups), everything is working fine. However, if with the filter, only a portion of the Groups are displayed in the CheckBoxList, even Groups that are not displayed are affected by the ManyToManyListRelationship. Is this normal?

    For example, let's say that we have the following CheckBoxList:

    1.  
    2. *
    3. *
    4.  
    5. *

    Where the numbers represent the Group IDs and the asterisks represent the selected items based on the LinkMembers. And let's say that I use a filter to only display the items with an even numbered ID in the CheckBoxList:

    2. *
    4.

    Then, when the Save button is clicked, even odd-numbered items that are not displayed in the CheckBoxList will be affected, and when the CheckBoxList will be displayed again without being filtered, we will see the following:

     

    1.  
    2. *
    3.  
    4.  
    5.  

     I would have expected the odd-numbered items to remain untouched.


    ManyToManyListRelationship:

    <data:ManyToManyListRelationship

        ID="ClientClientGroupeRelationship"

        runat="server">

        <PrimaryMember ID="PrimaryMember1" runat="server"

            DataSourceID="ClientDataSource"

            EntityKeyName="ClientID"

        />

        <LinkMember ID="LinkMember1" runat="server"

            DataSourceID="ClientGroupeDataSource"

            EntityKeyName="ClientID"

            ForeignKeyName="GroupeID"

        />

        <ReferenceMember ID="ReferenceMember1" runat="server"

            DataSourceID="GroupeDataSource"

            ListControlID="cblGroupes"

            EntityKeyName="GroupeID" 

        />

    </data:ManyToManyListRelationship>

    Reference Member DataSource:

     

    <data:GroupeDataSource ID="GroupeDataSource" runat="server"

        EnableSorting="false"

        SelectMethod="GetAll" >

        <Parameters>

            <data:SqlParameter Name="WhereClause" UseParameterizedFilters="false">

                <Filters>

                    <data:GroupeFilter Column="GroupeTypeID"  ControlID="ddlGroupeTypes" />

                </Filters>

            </data:SqlParameter>

        </Parameters>

    </data:GroupeDataSource>

    Is it a bug or the normal behavior of the ManyToManyListRelationship? If it is the normal behavior, how can have a CheckBoxList with only a subset of the elements in cases where the whole set is too large?

    Cheers!

    JF

     

    • Post Points: 35
  • 08-01-2007 9:25 AM In reply to

    • roonz
    • Not Ranked
    • Joined on 08-01-2007
    • Posts 2
    • Points 40

    Re: ManyToManyListRelationship with filtered Reference Members

    I have the same problem, has any found a solution to this. If I have two listboxes on the form, say the first one bound to the odd items and the second one bound to the even items, the page clobbers the first listboxes values and only saves the second one. This is really stalling my project.
    Thanks in advance
    roonz

    • Post Points: 35
  • 12-04-2007 8:03 AM In reply to

    • velum
    • Top 25 Contributor
    • Joined on 07-14-2006
    • Montréal, Qc, Canada
    • Posts 186
    • Points 4,686

    Re: ManyToManyListRelationship with filtered Reference Members

    Hi Roonz! 

    I don't have that problem anymore. Do you till have it? I don't think I've done anything special to solve it. Maybe an Update of the .netTiers templates solved this one. I am not sure.

    Cheers!

    JF 

    • Post Points: 35
  • 12-04-2007 11:36 PM In reply to

    • roonz
    • Not Ranked
    • Joined on 08-01-2007
    • Posts 2
    • Points 40

    Re: ManyToManyListRelationship with filtered Reference Members

    I got this working by creating a custom sproc which filters on the LookupType field. I then created a custom webdata source which I bind the listbox to. From there nettiers works fine. it inserts and deletes the data correctly. 

    • Post Points: 5
Page 1 of 1 (4 items) | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems