Advanced filter builder control: disable "show save options" does not work

Odpovědět Advanced filter builder control: disable "show save options" does not work

  • 4. května 2012 8:21
     
     

    Dear all,

    I recently evaluated the advanced filter builder control in Lightswitch and found it to be a very nice and useful extension.

    The only problem I have with it is that I cannot disable the save options as shown in the screenshot below:

    On the property page of the control there is an option checkbox as shown below but in checked as well as unchecked state the save option elements remain visible.

    Does anyone have an idea how to fix this?

    Thanks a lot for your help.

Všechny reakce

  • 5. května 2012 5:36
     
     Odpovědět Obsahuje kód

    This is a bug in the filter control.  You can wait for Microsoft to release a fix... or if you've got the source code downloaded (in my case, I downloaded the VS 11 Beta compatible version), you can fix it yourself, assuming you've installed the necessary Visual Studio SDK and LightSwitch Extensibility Toolkit (again I've linked to the VS 11 Beta compatible versions).

    In the VB source for the Filter Control, open FilterControl.Client\Presentation\Controls\FilterBuilderControl.xaml.

    Find this part:

            <StackPanel Orientation="Horizontal" Grid.Row="0" Grid.ColumnSpan="3"
                            Visibility="{Binding ElementName=root, Path=DataContext.Properties[LightSwitchFilter:FilterBuilderControl/ShowSaveOptions], Converter={StaticResource booleanToVisibilityTrue}}">
    

    and replace LightSwitchFilter with FilterControl

    Open FilterControl.Common\Resources\ModuleResources.resx

    Add a line with Name of ShowSaveOptions_Description and Value Show Save Options

    Add a line with Name of ShowSaveOptions_DisplayName and value Show Save Options

    Open FilterControl.Vsix\source.extension.vsixmanifest and increase the version (I changed it to 1.5.1) so that you can install the new vsix without uninstalling the old one.

    Build the solution.  Close Visual Studio.

    Make sure you've backed up your LightSwitch project before proceeding, as upgrades to extensions can sometimes be finicky.

    Install the new vsix (it should be under the FilterControl.vsix\bin\Release subfolder of the FilterControl project).


    My Blog: dotnetlore.com Twitter: @DotNetLore

    • Označen jako odpověď Dan721 5. května 2012 20:27
    •  
  • 5. května 2012 20:27
     
     

    Jewel,

    Thank you so much for your detailed response. It works exactly the way you described - problem solved.

  • 6. října 2012 13:55
     
     

    Edit: The solution was to copy the .targets file that is created when unzipping the LightSwitch Extensibility ToolKit. Directions are included in a README file within the zip file.

    I am running Visual Studio 2012, and have installed the full VS 2012 SDK, and the LightSwitch Extensibility ToolKit. But with I try to load the project I am getting the following error:

    C:\Users\jason\Downloads\Filter Control\VB\FilterControl\FilterControl.Lspkg\FilterControl.Lspkg.vbproj : error  : The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\LightSwitch\v2.0\Microsoft.LightSwitch.Toolkit.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.  C:\Users\jason\Downloads\Filter Control\VB\FilterControl\FilterControl.Lspkg\FilterControl.Lspkg.vbproj

    I'm assuming I am missing a required set of files, but I'm not too sure which files, or where to find them.

    Thanks,

    Jason


    jason


    • Upravený jasonwhitestl 6. října 2012 21:18 Found solution
    •  
  • 29. prosince 2012 16:16
     
     

    I just upgraded a project from VS2010 to VS2012 and had to deal with issues in the FilterControl same as I did in VS2010. Ironically the same bug exist in the VS2012 version. Seems like they could have fixed that.  I want to share part of my experience with you, as I ran into a peculiar issue. 

    Having both the _clauseType not public serialization error outlined in other messages (http://social.msdn.microsoft.com/Forums/en-US/lsextensibility/thread/322b0220-04a4-4c2d-bc7d-5fee9b14ab2f/), and the one here where the save options checkbox was not on the Properties panel for the Advanced Filter Term control, I updated the code as suggested, recreated the FilterControl.vsix, and reinstalled package as instructed.  But then using it in my target project would result in the same issues, as if I had not updated the extension at all.

    Reviewing the references in my target project for the Client and Server projects, I noticed that the references for the FilterControl dlls were being referenced to a subfolder of my target project named: ..\Visual Studio 2012\Projects\<target project>_Pvt_Extensions\FilterControl\Client\Reference for the Client project references, and ..\Visual Studio 2012\Projects\<target project>\_Pvt_Extensions\FilterControl_sav\Server\Reference for the Server project references. 

    The updated dlls for the FilterControl are in my Filter Control project folder: ..\Visual Studio 2012\Projects\Filter Control\VB\FilterControl\FilterControl.Client\Bin\Release for the Client project

    \Visual Studio 2012\Projects\Filter Control\VB\FilterControl\FilterControl.Common\Bin\Release for the Common Project

    \Visual Studio 2012\Projects\Filter Control\VB\FilterControl\FilterControl.Server\bin\Release

    I have noticed that every time I redeploy the FilterControl.vsix extension, the references in my target project get changed back to the <target project>\_PVT_Extensions subfolder structure which are not getting updated with deployment, so every time I have to change the references to the FilterControl project where the updated dlls are. I don't know why this is happening.  Would be good if someone could shed some light, but at least I know how to deal with it.

    So if you are making changes as described on this page and others to resolve the issues with the FilterControl and you are not seeing your changes, the above may be your issue.

    One last thing. The Save button on the control does save the criteria to an xml file in IsolatedStorage.  This is found under (Win7): C:\Users\<your user>\AppData\LocalLow\Microsoft\Silverlight\is...  Just navigate here and search for .reports.  The criteria is stored in a file named as: <screen name>.<collection name>.<control name>.reports You even view it and see the criteria you had specifed.  Problem is that for some reason the extension will not retrieve this info after the screen is closed and reopened, nor does the drop down selection work correctly when you have saved different sets of criteria and try to switch your selection.  When I get a chance I will attempt to review the code and see if I can fix that.  For now I just disable the display of the Save options.

    It would be REALLY NICE if the author would address these issues.  The control is almost a necessity in many projects, fixing these deficiencies would escalate it from great to AWESOME.

    LThibx


    Thanks LThibx

  • 9. května 2013 18:10
     
     

    Hi,

    Did you ever find a resolution to the reports not saving correctly?

    Thanks


    Neil Thibeault