1

I have a problem with the values of aChecklist that I populate from a query and it is inside a PopUp. Here is the web design:

<dx:ASPxCheckBoxList ForeColor="#00489e" ID="checkListPanl runat="server" ValueType="System.String" RepeatColumns="4">

 <ValidationSettings  EnableCustomValidation="true" ValidationGroup="entryGroup" SetFocusOnError="true" ErrorDisplayMode="Text"    
ErrorTextPosition="Bottom" CausesValidation="true"> 
 <RequiredField ErrorText="Elija al menos una unidad" IsRequired="true" />
 <ErrorFrameStyle ForeColor="Red" Font-Size="10px">
 <ErrorTextPaddings PaddingLeft="0px" />
 </ErrorFrameStyle>
 </ValidationSettings>
</dx:ASPxCheckBoxList>

And this is where I get the selectedvalues. This is inside a button that saves the results and insert the values in the database:

While index < checkListPanl.SelectedValues.Count()
   valores = checkListPanl.SelectedValues.Item(index).ToString()
   If resultado = "" Then
      resultado = Chr(39) + valores + Chr(39)
   Else
      resultado = resultado + ", " + Chr(39) + valores + Chr(39)
   End If
   index = index + 1
End While

The problem is that this works fine and I get the SelectedValues.Count() to the correct amount BUT ONLY when I place it right on the webpage, but as soon as I put it inside a modal (popup) The SelectedValues.Count() get "0" even when I select all the checkboxes.

I don't know if this is important but here is the aspx of the modal:

    <dx:ASPxPopupControl ID="popUpCrearUsuarios" runat="server" CloseAction="CloseButton" ClientInstanceName="popUpCrearUsuarios" EnableViewState="False"
                Modal="True" Width="650" HeaderText="CREAR SOLICITUD" PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter" Theme="Metropolis" ShowPageScrollbarWhenModal="True">

                <HeaderStyle Font-Names="verdana" BackColor="#00489e" HorizontalAlign="Center" Font-Bold="true" ForeColor="White" />
                <ContentCollection>
                    <dx:PopupControlContentControl runat="server">
                        <dx:ASPxPanel ID="ASPxPanel1" runat="server">
                            <PanelCollection>
                                <dx:PanelContent runat="server">
                                    HERE GOES THE CHECKLIST
                                </dx:PanelContent>
                            </PanelCollection>
                        </dx:ASPxPanel>
                    </dx:PopupControlContentControl>

                </ContentCollection>
            </dx:ASPxPopupControl>
sedders123
  • 791
  • 1
  • 9
  • 19
  • Hello! I solved the issue. The thing was that all the ChekBoxes of the CheckList were not loaded in the "innit event" but through the selection of an item in a Combobox. I changed it and now the loop in the button counts all the selected items. I don't quite understand why that happens, so if anyone could help me understand it I would be very very greateful. Is this something related to the order of the events ? like: 1.- Innit, then render, then load? And as I was giving values in the page_load the innit of the CheckList triggered first and cleared it, so the button has nothing to get? is it? – Dario Irribarra Jan 09 '19 at 13:05

0 Answers0