locked
Set query used with Auto? Or specify query of ACBs in pencil-icon edit box? RRS feed

  • Question

  • In a datagrid I can change an autocomplete box to use a different query, great. However when I click the pencil icon and pull up that edit dialog, the autocomplete box here doesn't use the query.

    I assume I can't change what's used here, that it just uses Auto.

    Is there somewhere I can set what query should be 'Auto' for a particular relationship property on an entity?

    (If the answer is no I will probably just create a separate entity in RIA Services to do this so that the default query really is the right, it's easy enough. I'd rather not disable the edit pencil.)

    Friday, May 10, 2013 2:55 PM

Answers

  • I made a separate entity in RIA Services. This actually worked to my advantage because then it has its own unique Summary field. This way I can refine my autocomplete box selection with a query when the data is available (like if I'm making cascading ACBs), and if not, the summary still includes the info from the ACBs that would have narrowed the list so everything is still differentiated and/or grouped, the list is just a bit longer. Excellent.
    Friday, May 10, 2013 5:13 PM

All replies

  • I made a separate entity in RIA Services. This actually worked to my advantage because then it has its own unique Summary field. This way I can refine my autocomplete box selection with a query when the data is available (like if I'm making cascading ACBs), and if not, the summary still includes the info from the ACBs that would have narrowed the list so everything is still differentiated and/or grouped, the list is just a bit longer. Excellent.
    Friday, May 10, 2013 5:13 PM
  • Just for the sake of completeness (for anyone else reading this thread), the answer to your problem is that you have to actually add the alternative query to the screen, via Add Data Item (select Query, then your query's name), before you can select something other than Auto.

    Any queries that you've added to the screen, that return the same entity "shape" will be listed in the Choices dropdown box which you can select as an alternative to Auto.


    Yann Duran
         - Co-Author of Pro Visual Studio LightSwitch 2011
         - Author of the  LightSwitch Central Blog

    FREE Download: Luminous Tools for LightSwitch
    (a Visual Studio productivity extension for LightSwitch)
     
    Click Mark as Answer, if someone's reply answers your question
    Click  Vote as Helpful, if someone's reply is helpful
     
    By doing this you'll help everyone find answers faster.

    Saturday, May 11, 2013 3:00 PM
    Moderator
  • Actually that isn't the answer to my question, I already knew and use that. I'm asking how do you do that with the auto complete box that shows up on the separate "Edit Such and Such" modal dialog box that opens when you click the pencil edit icon on a row item in a data grid. This seems to be a special auto-created edit box that, as far as I can tell, uses Auto and will only use Auto, but I was asking to confirm. (Changing the query among the choices of the ACB on the data grid itself unfortunately has no impact on the query used for the ACB within this modal edit dialog box.)
    Saturday, May 11, 2013 3:12 PM
  • Oh, if you're talking about ACB's in a modal dialog box (I missed that), then you can't change anything in them (apart from influencing what properties appear via the Display By Default checkbox in the table editor).

    Using a RIA service is a creative way to get around that.


    Yann Duran
         - Co-Author of Pro Visual Studio LightSwitch 2011
         - Author of the  LightSwitch Central Blog

    FREE Download: Luminous Tools for LightSwitch
    (a Visual Studio productivity extension for LightSwitch)
     
    Click Mark as Answer, if someone's reply answers your question
    Click  Vote as Helpful, if someone's reply is helpful
     
    By doing this you'll help everyone find answers faster.

    Sunday, May 12, 2013 3:56 AM
    Moderator