MutuallyExclusiveCheckBoxExtender not working with nested listview controls

Last post 12-02-2009 12:44 PM by s_nesh. 1 replies.

Sort Posts:

  • MutuallyExclusiveCheckBoxExtender not working with nested listview controls

    12-02-2009, 7:51 AM
    • Member
      50 point Member
    • s_nesh
    • Member since 11-13-2009, 7:32 AM
    • United Kingdom
    • Posts 22

    Hi


    i have a UI that has a (child) listview nested inside another (parent) listview. based on a particular value (say a count), parent listview populates the child  listview and renders 3 rows each for all the counts. 

    the child listview has a checkbox inside its item template, and i use a MutuallyExclusiveCheckBoxExtender to enable user to select just one check box out of the 3 rows rendered for it. 

    on running the code the first two checkboxes are made mutuallyexclusive, while the others remain as they are

    is there a known problem with MutuallyExclusiveCheckBoxExtender with nested listview controls?

    could some one please tell me the workaround ?


    my code is


    <asp:UpdatePanel ID="UPDropDownArea" runat="server" UpdateMode="Conditional">
                <ContentTemplate>
                <asp:ListView ID="ListView1" runat="server"
                        onitemdatabound="ListView1_ItemDataBound" ItemPlaceholderID="id1"
                        onitemcommand="ListView1_ItemCommand">
                <LayoutTemplate>
                    <asp:PlaceHolder ID="id1" runat="server"></asp:PlaceHolder>
                </LayoutTemplate>
                <ItemTemplate>
                <table>
                <tr>
                <td>
                    Drop Down Area:
                    <asp:Label ID="LblDropDownAreaNumber" runat="server" Text='<%#Eval("DDAreaId")%>'></asp:Label>
                    <asp:LinkButton ID="LkbUpdate" runat="server" Text="Save All" CommandName="SaveAll" CommandArgument='<%#Eval("DDAreaId")%>'></asp:LinkButton>
                    <asp:Label ID="LblSave" runat="server" Text="Unsaved"></asp:Label>
                    <br />
                    <asp:Label ID="LblTest" runat="server" Text="Correct Answer!!"></asp:Label>
                    <asp:LinkButton ID="LkbAdd" runat="server" Text="Add answer" CommandName="AddAnswer" CommandArgument='<%#Eval("DDAreaId")%>' ></asp:LinkButton>
                    
                </td>
                </tr>
                <tr>
                <td>
                    <asp:ListView ID="ListView3" runat="server" ItemPlaceholderID="id2">
                    <LayoutTemplate>
                        <asp:PlaceHolder ID="id2" runat="server"></asp:PlaceHolder>
                    </LayoutTemplate>
                    <ItemTemplate>
                    <table border="1px">
                    <tr>
                    <td>
                        <asp:Panel ID="PanelDropDownAreaAnswer" runat="server">
                        <asp:Label ID="Label2" runat="server" Text='<%#Eval("AnswerId")%>'></asp:Label>
                        <asp:CheckBox ID="ChkBoxAns" runat="server" />                   
                        <asp:MutuallyExclusiveCheckBoxExtender ID="MutuallyExclusiveCheckBoxExtender1" runat="server" Key="MyKey" TargetControlID="ChkBoxAns">
                        </asp:MutuallyExclusiveCheckBoxExtender>
                        <asp:TextBox ID ="TxtAns" runat="server" Text='<%#Eval("AnswerText")%>'></asp:TextBox>
                        <asp:Button  ID= "BtnDelete" runat="server" Text="Delete" CommandName="Delete" CommandArgument='<%#Eval("AnswerId", "ParentId")%>'/>
                        </asp:Panel>
                    </td>        
                    </tr>    
                    </table>                
                    </ItemTemplate>
                    </asp:ListView>
                </td>
                </tr>
                </table>
                </ItemTemplate>
                </asp:ListView>
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="DdlAreas" EventName="SelectedIndexChanged" />
                </Triggers>
                </asp:UpdatePanel>

    Neel

    Please mark this post as Answer if it helped you


  • Re: MutuallyExclusiveCheckBoxExtender not working with nested listview controls

    12-02-2009, 12:44 PM
    Answer
    • Member
      50 point Member
    • s_nesh
    • Member since 11-13-2009, 7:32 AM
    • United Kingdom
    • Posts 22

    well....i was using scriptmanager with mutuallyexclusivecheckboxextender and it seems like it doesnt work with that.

    i replaced the scriptmanager with toolkitscriptmanager and it started to work like a charm!!!

    strange thing to do but the only option i had !!

    hope this helps others too



    Neel

    Please mark this post as Answer if it helped you


Page 1 of 1 (2 items)