Proposed fire autoexec query on screen property change

  • Wednesday, August 22, 2012 10:38 AM
     
     

    Hi

    Because of a bug in the grid that messes up paging when 'autoexec' is turned off for the query I am trying to create a custom filter with autoexec on for my search form.

    See here for bug description:

    http://social.msdn.microsoft.com/Forums/en-US/lightswitch/thread/2a413a8c-0a60-4ce7-85ac-e8b2b108b60e

    Basically, I have a series of fields at the top of the form. For the drop downs when I change them the data grid below is automatically filtered which is fine. However, I have two fields that are properties. These are text boxes. With these the search is only fired when they lose focus. Which means that the user has to type in the box and then click somewhere else to make the search work.

    I could have a search button but then I'd have some fields that auto-filtered the data and some that didn't. Not very nice.

    Can anyone provide a solution?  I have tried the _changed event for the property and the _validate event but they are only fired when focus is lost.

    How can I get to the text changed event for the control and use this to fire the filtering?

    Or is there another way?

    thanks

    Gus

    BTW, I am using VS 2012 RTM.

All Replies

  • Wednesday, August 22, 2012 3:45 PM
    Moderator
     
     

    All you need to do is to have a non-visible boolean screen variable, which you set to false by default.

    Create/edit a parametrised query that accepts your boolean screen parameter value.

    Bind the query's boolean parameter to the screen variable (if you don't know hopw to do that, just ask).

    In the query's PreProcessQuery method, just add a final "(AndAlso boolParameter = true)" clause that causes no records to match.

    So, initially, no records will be displayed (because you're initially passing false). Whenever you've finished selecting your criteria, set the screen variable's value to true.

    Sorry if this doesn't make sense, it's almmost 2:00AM here in Melbourne, & the eyes are drooping a bit. :-)


    Yann - LightSwitch Central - Click here for FREE Themes, Controls, Types and Commands
     
    If you find a reply helpful, please click "Vote as Helpful", if a reply answers your question, please click "Mark as Answer"
     
    By doing this you'll help people find answers faster.

  • Thursday, August 23, 2012 7:43 AM
     
     

    thanks Yann

    yeah, I understand your method.  But I've decided for now to save time I've turned off paging as there is very little data and won't be for a few weeks and am using vertical scroll bars instead.

    I have used the feedback options in VS to raise this as a bug and hopefully get MS onto the case.

    I was really disappointed that this wasn't fixed in VS 2012 RTM. Especially since its been widely publicised and is easy to reproduce. AND is clearly in the LS standard grid alone.

    Come on MS, where are you?  Please fix this bug. We want paging to work!

    Gus

  • Tuesday, August 28, 2012 2:39 AM
     
     Proposed

    Hi

    Have you submit your feedback to Connect?http://connect.microsoft.com/site1231

    I think if you send it to connect you will know this bug's states.

    • Proposed As Answer by KMoon Tuesday, August 28, 2012 2:39 AM
    •  
  • Tuesday, August 28, 2012 8:39 PM
     
     Proposed

    Yes, as I stated above: "I have used the feedback options in VS to raise this as a bug and hopefully get MS onto the case." The ID is 759021. I have received a confirmation from MS about this and I can see the item when I go to the link. But I can't find it any other way. From MS:

    Greetings from Microsoft Connect! This notification was generated for feedback item: MS Lightswitch paging does not work when autoexec query is turned on which you submitted at the Microsoft Connect site. Thank you for your feedback. We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.

    • Edited by GusBeare Tuesday, August 28, 2012 8:40 PM
    • Proposed As Answer by KMoon Wednesday, August 29, 2012 4:16 AM
    •  
  • Wednesday, August 29, 2012 4:16 AM
     
     

    Hi

    So if this state changed you will recieve another mail.

    Please wait a feel of weeks.

  • Wednesday, August 29, 2012 6:32 AM
    Moderator
     
     

    That doesn't happen automatically, even for the person who submitted the report.

    There's an option you have to set before that happens. (I forget what the option is called). Unless some new template hits Connect like it has the forums, the option that I'm talking about is up near the top right of the submission. Something like "Follow", "Alert Me".


    Yann - LightSwitch Central - Click here for FREE Themes, Controls, Types and Commands
     
    If you find a reply helpful, please click "Vote as Helpful", if a reply answers your question, please click "Mark as Answer"
     
    By doing this you'll help people find answers faster.