FlexGrid Lightswitch - Two-column Filter

Posted by: leusilva on 9 September 2017, 8:31 am EST

  • Posted 9 September 2017, 8:31 am EST

    Hi, I'd like to know if it's possible to use FlexGrid's filter with the following scenario:

    Table Values
    Column A Column B column C
    1 1000 Mark
    2 3200 Jonh
    3 2000 Jonh
    4 1500 Mark
    5 1000 Mark
    6 2000 Mark

    If i've filter the Column C "Mark", the FlexGrid will hide the rows 2 and 3 correctly.
    But, when I try to filter the Column B, it shows ALL values intead of those are visible (e.g. 1000, 1500 and 2000 only)

    Is this possible? It's a matter of control's configuration?
    If it is possible, could you help me providing some example?

    By the way, congratulations for that control. It's amazingly simple to use!

    Thank's!
  • Replied 9 September 2017, 8:31 am EST

    Hello leusilva,

    I had written a blog on the same subject a couple years ago on C1FlexGrid for Silverlight. Since the LightSwitch version of C1FlexGrid is based on the silverlight version, I would request you to take a look at the article (http://our.componentone.com/2012/06/22/excel-like-filtering-in-silverlight-flexgrid/). The logic would remain the same except you'll need to modify some parts in the context of LightSwitch for eg. the CollectionView.

    Regards
    Abdias
  • Replied 9 September 2017, 8:31 am EST

    Hello luesilva,

    Do let me know if it works or if you need any help with it.

    Regards
    Abdias
  • Replied 9 September 2017, 8:31 am EST

    Hi, AbdiasM.
    I had almost succesfully integrated Flex Grid in my solution following your post.
    I say \"almost\" because i couldn\'t use the filter with custom classes (like, \"Clients\" e.g.). Since the component is used as a Silverlight User Control, it doesn\'t have access to the Application Data in Lightswitch\'s Data Layer.
    At this point, using the filters with primitive types (like string or dates) is sufficient.
    So, you post helped me a lot!! Thanks.
  • Marked as Answer

    Replied 9 September 2017, 8:31 am EST

    Hello leusilva,

    I'm glad to know that the post was helpful and you were able to use it in your application. :)

    Feel free to contact us in case you need any other help.

    Regards
    Abdias
  • Replied 9 September 2017, 8:31 am EST

    Hello Abdias.
    Since i've been testing the control about some days, I have now some doubts.

    1. It's possible to hide ou remove the "Add/Edit/Delete" standart buttons of Flex Grid? I've tried to set "AllowAddNew" to false, but it just disabled the buttons.

    2. If (1) isn't possible, how can I override the standart modal form the grid calls?

    Thanks again for your support!
  • Replied 9 September 2017, 8:31 am EST

    Hi, AbdiasM.
    thank you for you replay.
    I'll read that post and try to use it in my project.

    If it works, i'll let you know.

    thanks again!!
  • Replied 9 September 2017, 8:31 am EST

    Hello leusilva,

    Sorry for the delay in getting back to you. To hide/remove the standard Add/Edit/Delete button of C1FlexGrid, you need to delete these buttons from the CommandBar under C1FlexGrid. I've attached a screen shot for your reference. Please remove these buttons and also uncheck the "Show AddNewRow" checkbox from the Properties window of C1FlexGrid.

    Regards
    Abdias

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels