Ticket Q231473
Visible to All Users

Customising the incremental search in the ListBoxControl

created 16 years ago

Hi,
Is it possible to customise the incremental search facility in the list box control?
I have a listbox with items like:
Miss Alan
Mr Brown
Mr James
Mrs Jones
Mrs Smith
etc
And I would like to start the search ignoring the Miss/Mr/Mrs/etc.
Is it posible to subclass the control and override a function within it?

Show previous comments (4)
DevExpress Support Team 16 years ago

    Hi James,
    You can paint the highlighted text manually by using the DrawItem event. To learn how we paint a highlighted text, please see the DrawItemHighlight method in the BaseListBox.cs unit. An easier solution is to use the MultiColorDrawString method of the XPaint class. Such painting is implemented in the SortingBySummary section of the GridMainDemo demo (<DevExpress 2009.> \Components\Demos\XtraGrid\CS\GridMainDemo\GridMainDemo.sln). To review the necessary code, open the SortingBySummary.cs unit and review the gridView1_CustomDrawGroupRow procedure's implementation.
    Hope, this information will help you achieve the desired result. If you need any further assistance on this subject, please feel free to reactivate this ticket.
    Thanks
    Dimitros

      Hi Dimitros,
      Unfortunately I cannot even even get the "finding" part working, i.e. the KeyPress/FindNext methods are not being invoked in my class.
      As I asked can you provide a sample showing at least custom searching.

      DevExpress Support Team 16 years ago

        Hi James,
        Please review the attached sample and inform me whether it meets your requirements.
        To paint the highlighted text use the DrawItem event.
        Thanks
        Dimitros

        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.