Current filter:
                                You should refresh the page.
                                  • I have page that needed to display a variable number of equipment type selection lists each in an accordion by clicking a type image in the header of the accordion.
                                    The list items needed to display images along with the item value to indicate the item's status concerning three criteria.

                                    My approach was to create a usercontrol to handle an individual equipment type.

                                    It is an accordion with an image control and a textbox in the header and headerclosed templates.
                                    There is a single listbox in a single accordion item.
                                    The listbox is a checkcolumn mode using four fields.
                                    An itemtemplate is used to display the value field and status images.

                                    The main page has an asp repeater to instantiate the variable number of equipment usercontrols. 

                                    During page load each usercontrol databinds the listbox to create all listitems.
                                    Then at the databound event , the listitems are looped thru to compare to preselected values.
                                    The item.Selected = true if a match.

                                    The load seems to work fine.
                                    To keep it brief, I have javascript that handles user interactions with a clickable status image in the itemtemplate.
                                    It causes a click event on the listitem causing an unintended selection.
                                    The javascript handles this by unselecting all listitems and then recreating the prior selections using

                                    list_Obj.SelectValues(valReset_array);

                                     
                                    This all works okay until I need to save selections to the database.
                                    A callback is performed to poll each usercontrol for selected values.

                                    Each usercontrol has a public property;
                                    public string SelectedEquipmentItems
                                    {
                                      get { return GetSelectedEquipItems(); }
                                    }

                                    In the GetSelectedEquipItems() it is to return lstEquipTypes.SelectedValues .
                                    The issue is th e SelectedValues doesn't reflect the items selected on page.

                                    I can't figure out why.
                                • Marina (DevExpress Support) 12.06.2018

                                  Hi Kevin, 

                                  You have a rather complex layout and dependences. So, it would be helpful if you provide a sample that illustrates the issue or at least meaningful files that help us to reproduce the issue. Right now, it is hard to say why the issue occurs without debugging a project.

                                1 Solution

                                Creation Date Importance Sort by

                                The answer comes in two parts.

                                First, the page with this repeater code

                                <asp:Repeater ID="Repeater1" runat="server">
                                   <ItemTemplate> 
                                     <div class="col-xs-7 col-sm-4 col-md-4 col-lg-4 col-xl-3" style="padding: 6px 4px;">
                                        <uc1:EquipmentSelection ID="ucEquipSelect" runat="server"ClassId='<%# Eval("CLASS_ID") %>'
                                            OrgId='<%# Eval"ADMIN_ORG_ID") %>' AssignmentId='<%# Eval("ASSIGNMENT_ID") %>'/>
                                     </div>
                                  </ItemTemplate>
                                </asp:Repeater>

                                was databound in the Page_Init which gets the usercontrols set up before the ViewState.

                                Second, the user control with the BootstrapListBox that was losing selections needed to be databound during its own Init event (lstTypes_Init).


                                Then, the ListBox databound event was used identify pre-selected items in the collection to be set as selected.

                                Each user control can now be polled to get the selectedValues thru an exposed property to get user changes.

                                Thanks

                                • Marina (DevExpress Support) 12.07.2018
                                  Thank you for sharing your solution with us. It may be very helpful for other users.