Does the CheckListBox support Shift Range Select?
I'm confident I can write the code to handle this manually but thought I'd ask if there was a built in property first.
I want the user to be able to check/uncheck (n.b. not Select/Unselect) a range of items in a check list box. e.g. if the user check the 2nd item and then shift checks the 5th, it should automatically check Items 3 and 4.
Is their a built i
Hi Declan Hillier,
We have analysed your requirement for “Provide support for multiple selection using Shift key in WPF CheckListBox”. We have logged a feature request for the same. We will implement this feature in any of our upcoming releases.
At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision, technological feasibility, and customer interest. We will let you know when this feature is implemented. We appreciate your patience until then.
Thank you for requesting this feature and helping us define it. We are always trying to make our products better and feature requests like yours are a key part of our product growth efforts.
Feedback link: Provide support for multiple selection using Shift key in WPF CheckListBox in WPF | Feedback Portal (syncfusion.com)
If you have any more specifications/suggestions for the feature request, you can add them as a comment in the portal and cast your vote to make it count.
Regards,
Karthick Arjunan
Thank you. That's really great news that it'll be made part of the library.
In the meantime I have coded up a reasonably simple solution that others might find useful:-
private IdAndDescription mLastOption1ScenarioChecked;
private bool mEditingOption1Scenarios;
private void Option1ScenariosCheckedListBox_ItemChecked(object sender, Syncfusion.Windows.Tools.Controls.ItemCheckedEventArgs e)
{
if (Keyboard.Modifiers == ModifierKeys.Shift && !mEditingOption1Scenarios)
{
IdAndDescription firstItem = Option1ScenariosCheckedListBox.Items.Cast<IdAndDescription>().FirstOrDefault(i => i == mLastOption1ScenarioChecked || i == e.Item);
IdAndDescription lastItem = Option1ScenariosCheckedListBox.Items.Cast<IdAndDescription>().LastOrDefault(i => i == mLastOption1ScenarioChecked || i == e.Item);
mEditingOption1Scenarios = true;
Option1ScenariosCheckedListBox.SelectedItems.Clear();
for (int i = Option1ScenariosCheckedListBox.Items.IndexOf(firstItem); i <= Option1ScenariosCheckedListBox.Items.IndexOf(lastItem); i++)
{ Option1ScenariosCheckedListBox.SelectedItems.Add(Option1ScenariosCheckedListBox.Items[i]); }
mEditingOption1Scenarios = false;
}
mLastOption1ScenarioChecked = e.Item as IdAndDescription;
}
Set the method as the item checked handler for the checked list view and it works fine (you'll have to adjust the object types as appropriate).
Hi Declan Hillier,
Thank you for your thoughtful suggestion. We will take it into consideration and aim to enhance our Syncfusion control accordingly in the future. Should any new issues arise, please don't hesitate to initiate a new forum thread. We are always eager to assist you!
Regards,
Karthick Arjunan
- 3 Replies
- 2 Participants
-
DH Declan Hillier
- Jul 19, 2024 08:36 AM UTC
- Jul 25, 2024 01:06 PM UTC