Ticket Q288344
Visible to All Users

SearchLookUpEditStyleSettings - I want to not show any search results until the user has typed in at least two characters

created 12 years ago

If I want to not show any search results until the user has typed in at least two characters, is that possible? If so, can you point me to documentation on this or an example. I've been looking through the SearchLookUpEditStyleSettings documentation and don't see how to accomplish this.

Should I be creating a new ticket when I have a followup question like this?

Thanks again,
Bill

Answers

created 12 years ago (modified 12 years ago)

Hi Bill,
Our LookUpEdit provides a different searching mechanism. In the SearchLookUpEditStyleSettings, the FindMode property specifies the conditions under which the search can be started.
If the FindMode is set to Always, the search will be started after a small delay. It is done in order not to start the search when a user has not yet ended typing the condition string. This delay can be specified via the DataViewBase.SearchDelay property. To change the delay, set this property for the grid's view in the popup content template.
Does this capability meet your requirements?

    Show previous comments (3)
    DevExpress Support Team 12 years ago

      I apologize for this misunderstanding. The cause of this exception is that version 12.1.4 does not contain the {dxgt:TableViewThemeKey ResourceKey=SearchPanelWidth} theme key. To fix this exception, simply do not use this resource:

      XML
      <Style x:Key="{dxgt:TableViewThemeKey ResourceKey=SearchPanelContentTemplate}" TargetType="{x:Type ContentControl}"> <Setter Property="dx:FocusHelper2.Focusable" Value="False"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate> <Grid Background="{DynamicResource {dxgt:TableViewThemeKey ResourceKey=SearchPanelBackground}}"> <local:MySearchControl x:Name="PART_SearchControl" Width="260" .../> <!-- ... --> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style>

      Let me know if you need further assistance.
      Thanks

        Thank you for that width correction. When I run the sample, as soon as I click on the column, I see the list of items. The search does indeed wait until you type multiple characters, but the list is already showing. My customer's desire is to hide the complete list, and only display portions of list that match the search after typing characters. Is there a way to hide the selection items until the search a number of characters has been entered?
        Thanks again,
        Bill

        DevExpress Support Team 12 years ago

          You can implement this functionality by overriding the UpdateFilterCriteria in the MySearchControl class. In this method, modify the FilterCriteria property if the SearchText is empty in the following manner:

          C#
          protected override void UpdateFilterCriteria() { if(ColumnProvider == null) { FilterCriteria = null; return; } if(string.IsNullOrEmpty(SearchText)) { FilterCriteria = SearchControlHelper.GetCriteriaOperator(ColumnProvider, FilterCondition, Guid.Empty.ToString(), CriteriaOperatorType); return; } FilterCriteria = SearchControlHelper.GetCriteriaOperator(ColumnProvider, FilterCondition, SearchText, CriteriaOperatorType); }

          If you have additional questions, feel free to reactivate this thread.
          Thanks

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.