ACTIVATING MULTI SELECTION WITH CHECKBOXES IN A LIGHTSWITCH GRID WITH A ONE-LINER
2013/04/02 · by paul van bladel · in Uncategorized
Introduction
In a business app grid, you often need the ability the select multiple rows and apply an action on the selected rows.
Wouldn’t it be great if we could inject this via following “one-liner”;
?
|
The line that really matters is the extension method “AddCheckBoxColumnForMultiSelection”. It takes at input an ObservableCollection which will hold the selected items.
As you can see, there is a button called “Do Something With Selection”. We can tweak also the CanExecute behavior as follows:
?
1 2 3 4 5 6 7 8 9 10 11 12 | |
This will make sure the button is not clickable if there are no checkboxes checked.
What’s our base infrastructure for doing this?
That’s a bit more involved. But it doesn’t matter, since it’s implemented as an extension method, the whole functionality becomes a … one liner.
?
|
Can I download it?
No, you can’t because I stopped uploading samples, as from today. Full stop.
But, … you can directly inject the functionality with NuGet into the silverlight client project. (at least when you use the latest LightSwitch version)