Default values for AutoCompleteFilter (from Futures) RRS feed

  • Question

  • User1414551024 posted


    DynamicData scaffolding makes good use of foreign-key relationships by displaying a column 'View child objects' - that when clicked navigates user to screen with automatically correctly set filters (on parent object).

    AutoCompleteFilter from FuturesSamples is a nice alternative to default dropdowns for foreign-keys because it allows both typing and selecting from (matching) list. However, because it works differently (with ajaxtoolkit autocomplete extender / webservice to get matching list) I'm not sure how best to approach to have initial value (from querystring / passed on from parent screen) displayed in textbox:

    I have so far changed one line:

    <asp:HiddenField runat="server" ID="AutocompleteValue" Value="<%# InitialValue %>" />

    But I also need text-equivalent for the textbox. Do I need to get the text myself from db based on id that I have, or some other more elegant way?

    Tuesday, August 19, 2008 9:05 AM

All replies

  • User-797310475 posted

     There's a method (something like GetDisplayString) on MetaTable that you could call to get the display string for a given row. However, you will have to pass in an actual instance of the object. In the Futures project there are some Linq helpers for querying for items in a generic way. Have a look at how the autocomplete service generates its results for some suggestions. (sorry i'm not providing more details, i'm away from my dev box right now).

    Tuesday, August 19, 2008 12:39 PM