Current filter:
                                You should refresh the page.
                                  • Issue:
                                    Invoking the CheckedListBoxControl.SetItemChecked method passing a negative index as parameter will throw ArgumentOutOfRangeException

                                    How To Reproduce (Code Example):

                                    [C#]
                                    this.CheckedListBoxControl1.SetItemChecked(-1, true);

                                    Expected Behavior:

                                    The method should have no effect, and no exception should be thrown.
                                    As stated in the documentation, for the index param:
                                    "An integer value representing the zero-based index of the item to be changed. If it is negative or exceeds the last available index, the method will have no effect."
                                    https://documentation.devexpress.com/WindowsForms/DevExpress.XtraEditors.BaseCheckedListBoxControl.SetItemChecked.method

                                    Tested Versions:

                                    - 19.2.3.0
                                    - 19.1.6.0

                                • Igor (DevExpress Support) 11.07.2019

                                  Hi Jonatas,

                                  I have reproduced the behavior you described and passed this ticket to our developers for further investigation. Please bear with us. We will notify you as soon as we make any progress.

                                1 Solution

                                Creation Date Importance Sort by

                                Hi,

                                Thank you for your patience.
                                This is the expected behavior. Starting with version 12.1.5, ArgumentOutOfRangeException is thrown in this case. This allows you to handle it and prevent unexpected behavior in your project.
                                We will correct the SetItemChecked article in our documentation accordingly.

                                • Jonatas Hudler 11.08.2019

                                  OK Igor. Thank you for the clarification!

                                • Igor (DevExpress Support) 11.08.2019

                                  You are always welcome, Jonatas!