Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • Hi,

                                    I have a problem in LookupEdit style is checkbox.In My window i have two option buttons.LookupEdit itemsource and visibility is binded to one of the option button.If i select some check boxes in LookupEdit and then I select second option button and then i come back and select the the fist option button (binded to the lookupedit) still the selection check box are checked .I want to clear all selection when i press the option button.I use unselectall() in that option button selected event,but check boxes are till checked
                                     private void Select_Selected(object sender, RoutedEventArgs e)
                                            {
                                                
                                                if ((bool)Select.IsSelected)
                                                {
                                    lstItems.UnSelectAll();
                                    }}

                                    after calling unselectall() selecteditem.count is zero

                                    but checkboxex are checked

                                    xaml

                                    <dxdo:LayoutControlItem ControlHorizontalAlignment="Left" ItemHeight="Auto" ItemWidth="Auto">
                                                                    <dxe:ListBoxEdit Name="lstItems" StyleSettings="{dxe:CheckedListBoxStyleSettings}" Background="Transparent"
                                                                      Height="150" Width="150" SelectedIndexChanged="lstItems_SelectedIndexChanged" >
                                                                        <dxe:ListBoxEdit.Visibility>
                                                                            <MultiBinding Converter="{StaticResource ListBoxVisibility}" >
                                                                                <Binding ElementName="Select" Path="IsSelected"/>
                                                                                                                        </MultiBinding>

                                                                        </dxe:ListBoxEdit.Visibility>
                                                                        <dxe:ListBoxEdit.ItemsSource>
                                                                            <MultiBinding Converter="{StaticResource ListboxItemSource}" >
                                                                                <Binding ElementName="Select" Path="IsSelected"/>
                                                                            </MultiBinding>
                                                                        </dxe:ListBoxEdit.ItemsSource>
                                                                    </dxe:ListBoxEdit>

                                0

                                Hi Abhilash,

                                Unfortunately, it's difficult to clearly diagnose this problem without being able to reproduce it locally.
                                Could you please provide us with a sample illustrating your issue?
                                We will examine it, and do our best to help you.

                                Thanks,
                                Andrew

                                0

                                Hi,

                                These are the code for options

                                <dxdo:LayoutControlItem ItemHeight="Auto" ItemWidth="Auto">
                                                                <dxe:ListBoxEdit Name="lstMasterNotes" StyleSettings="{dxe:RadioListBoxEditStyleSettings}" Background="Transparent"
                                                                      Height="100" >

                                                                    <dxe:ListBoxEditItem Name="All" Selected="All_Selected" >All</dxe:ListBoxEditItem>
                                                                    <dxe:ListBoxEditItem Name="Manually" Selected="Manually_Selected">Enter Manually</dxe:ListBoxEditItem>
                                                                    <dxe:ListBoxEditItem Name="Select" Selected="Select_Selected">Select from List</dxe:ListBoxEditItem>
                                                                </dxe:ListBoxEdit>
                                                            </dxdo:LayoutControlItem>

                                This is the code for ListBoxEdit and bind to a dataset,this will display and bind when i press select option and i select some values(by clicking check boxes).then i select other option button ListBoxEdit is invisible ,then i came back and i press "manullay" option the listbox again displayed,but the problem is that the check boexs before i selected is till selected,i want to clear that checkboxes

                                thank you
                                abhilash

                                <dxdo:LayoutControlItem ControlHorizontalAlignment="Left" ItemHeight="Auto" ItemWidth="Auto">
                                                                <dxe:ListBoxEdit Name="lstItems" StyleSettings="{dxe:CheckedListBoxStyleSettings}" Background="Transparent"
                                                                  Height="150" Width="150" SelectedIndexChanged="lstItems_SelectedIndexChanged" >
                                                                    <dxe:ListBoxEdit.Visibility>
                                                                        <MultiBinding Converter="{StaticResource ListBoxVisibility}" >
                                                                            <Binding ElementName="Select" Path="IsSelected"/>
                                                                                                                    </MultiBinding>

                                                                    </dxe:ListBoxEdit.Visibility>
                                                                    <dxe:ListBoxEdit.ItemsSource>
                                                                        <MultiBinding Converter="{StaticResource ListboxItemSource}" >
                                                                            <Binding ElementName="Select" Path="IsSelected"/>
                                                                        </MultiBinding>
                                                                    </dxe:ListBoxEdit.ItemsSource>
                                                                </dxe:ListBoxEdit>
                                                                
                                                            </dxdo:LayoutControlItem>

                                0

                                Hi Abhilash,

                                Thank you for your update. I have tried to reproduce this issue based on your description but with no luck so far. The ListBoxEdit's selection can be successfully cleared via the UnSelectAll method. I have attached a small sample project that demonstrates this approach in action. Please review it and let me know whether or not it helps you solve the problem. If it does not, please modify the project to illustrate the problem that you have faced, and we will do our best to find an appropriate solution.

                                Thanks,
                                Dmitry

                                Q385107.DXSample.zip
                                0

                                Hi,

                                Now Listbox check boxes was cleared.but i got an error "Collection was modified; enumeration operation may not execute."

                                I copy my sample code

                                <dxe:ListBoxEdit Name="lstItems" StyleSettings="{dxe:CheckedListBoxStyleSettings}" Background="Transparent"
                                                                  Height="150" Width="150" SelectedIndexChanged="lstItems_SelectedIndexChanged"
                                                                                 
                                                         Visibility="{Binding Path=IsSelected, ElementName=Select, Converter={StaticResource BoolToVisibilityConverter}}" >
                                                                                                        <dxe:ListBoxEdit.ItemsSource>
                                                                        <MultiBinding Converter="{StaticResource ListboxItemSource}" >
                                                                            <Binding ElementName="Select" Path="IsSelected"/>
                                                                        </MultiBinding>
                                                                    </dxe:ListBoxEdit.ItemsSource>
                                                                </dxe:ListBoxEdit>

                                code behind
                                 private void Select_Selected(object sender, RoutedEventArgs e)(radio button)
                                        {

                                lstItems.UnSelectAll();
                                }

                                 private void lstItems_SelectedIndexChanged(object sender, RoutedEventArgs e)
                                        {
                                            lstBoxItemSelected.Items.Clear();

                                            
                                                ObservableCollection<object> selectedExceptiontItems = lstItems.SelectedItems;

                                                foreach (object obj in selectedExceptiontItems)
                                                {
                                                                       lstBoxItemSelected.Items.Add((string)obj);
                                                  
                                                }
                                           

                                        }

                                I have one more radio button named Manually
                                First when i press select radio button listbox is display and have table values,then i selec some checkboxes that are added to another listbox.Then I select manually radio button.then i came back and select select radio button then i got the above error

                                can you fix it?
                                Thank you
                                Abhilash Francis

                                0

                                Hi

                                Actually that error occur when i check select all,then i go to manually radio button click

                                if i select one check box in listbox ,then i go to manually radio button click then no error

                                Thank you
                                Abhilash Francis

                                0

                                Hi

                                If i select "select all" check box then call unSelectall method.its throw the error

                                Thank you
                                Abhilash Francis

                                0

                                Hi Abhilash,

                                I'm afraid that it is difficult to recreate the problem based on your description. I'll try to modify my sample project to reproduce this problem but need extra time to prepare it. Therefore, it would be great if you could attach a sample project that can be used to demonstrate this issue in action. It will help to diagnose the problem faster.

                                Thanks,
                                Dmitry

                                0

                                Hi,

                                Can you have any idea to fix this bug?

                                Thank you
                                Abhilash Francis

                                0

                                Hi Abhilash,

                                I'm still unable to create a complete runnable application based on the code you have provided.

                                The most likely cause of this exception is that the 'selectedExceptiontItems' collection changes when you add new items to the 'lstBoxItemSelected' collection within the foreach loop:

                                	
                                [C#]
                                foreach (object obj in selectedExceptiontItems) { lstBoxItemSelected.Items.Add((string)obj); }

                                You need to make sure that changes in the 'lstBoxItemSelected' collection do not affect the 'selectedExceptiontItems' one.

                                Alternatively, you can try to create a copy of the 'selectedExceptiontItems' collection and then iterate through this new collection:

                                	
                                [C#]
                                ObservableCollection<object> selectedExceptiontItems = lstItems.SelectedItems; ObservableCollection<string> selectedExceptiontItemsStrings = new ObservableCollection<string>(); foreach (object obj in selectedExceptiontItems) { selectedExceptiontItemsStrings.Add((string)object); } foreach (string str in selectedExceptiontItemsStrings) { lstBoxItemSelected.Items.Add(str); }

                                If neither of the approaches help, please modify the attached sample project and complete it with the 'lstBoxItemSelected' object and 'ListboxItemSource' converter implementations since I have not found these objects in the provided code snippet.

                                Thanks,
                                Dmitry

                                Q385107.DXSample.Incomplete.zip

                                To start a chat you should create a support ticket


                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2014 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners