The easiest way to create business applications for the Desktop and the Cloud
A common request that the LightSwitch team receives is to provide a control to deal with many-to-many relationships (ex. the relationship between Categories and Blog Posts). One of the more common ways to deal with this is by displaying a list of checkboxes or a tree of checkboxes. We've just released it an extension that provides this functionality. Here's a quick list of the extension's functionality:
You can download the extension and find instructions on how to use it here:
Many to Many Control for Visual Studio LightSwitch
Bad link to 'Many to Many Control for Visual LighSwitch'. :-(
I published a walk-thru of the control at:
thanks this is great. will it be avialble in c#
Is there a many-to-many control that uses combo box instead of check boxes?
Please see my question at social.msdn.microsoft.com/.../a55ca06d-7406-4115-8d4a-855ebc12aef6
@bhuven # -You can use the extension in either VB or C# LightSwitch projects. However the source code is only available is VB.
Control is excellent.
Reduces programming a lot of code.
The field shown in the checkbox list is defined as "summary"-field, but it is not really the SUMMARY field of the table (that is defined in "Choices navigation property").
I found out that it is the first string field in the table.
But when I place some other field as first string field in the table an error occurs: "Object reference not set to an instance of an object." every time a listbox item is displayed.
To Albert Korstanje: I am getting "Object reference not set to an instance of an object." when trying to use calculated property as first string field (reason seems to be that calc property value is evaluated after binding, so value is null when UI tries to access it). But any other string field is fine. Workaround for showing calculated column is defining it in SQL Server table (in db) rather than in app
To Peter Durica:
Thanks for your positive posting.
I have added a field in the table that replaces the calculated field and it is a pretty good workaround, although it takes extra storage capacity.
Remains the problem that it is strange that the control does not take the defined "summary" field.
Great control thanks!! However, found a problem when the Summary Property is a calculated property. It throws an "Object reference not set to an instance of an object" exception in the UpdateText method in CheckboxList.xaml.vb. Also, the GetSummaryProperty seems to only pick the first string property instead of picking the defined Summary Property. So, to reproduce this error you need to make the calculated property the first string property in the entity.
I'm having trouble with building my LightSwitch application via TFS2012 Build when I have the Many to Many Control referenced. I get the following error:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\LightSwitch\v2.0\Microsoft.LightSwitch.targets (146): The "BuildSchema" task failed unexpectedly.
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
The project builds fine locally in VS2012 and I am using my machine as a Build Agent, so I know the machine has everything installed that it needs.
If I simply remove the Many to Many control reference, the TFS Build Agent can build the project fine.
Any luck out there getting this control to work in VS2013 Lightswitch Silverlight? I've tried but am getting a weird runtime error where the XAML is trying to load version 18.104.22.168 of System.Core instead of SL5's 22.214.171.124. My references are all to SL5 assemblies so not sure what's going on.