Ticket Q243835
Visible to All Users

filter popup

created 15 years ago

Hi,
Suppose I have two columns A and B, if my column A is filtered with certain data, then i would like to filter on column B. But the column B's filter popup will show all the items (before A is filtered). How can i show only the filtered items (by A) in the column B's filter popup?
Thanks before hand,
Longchrea NEAK

Show previous comments (2)
DevExpress Support Team 15 years ago

    Hello,
    Sorry, but this behavior is by design and we don't plan to change it in the future. However, if you want, you can use a workaround to solve this task. Please see the following code:

    C#
    void MyTableView_ShowFilterPopup(object sender, FilterPopupEventArgs e) { List<object> list = new List<object>(); object[] objs = myTableView.GetUniqueColumnValues(e.Column, false); foreach(CustomComboBoxItem item in e.ComboBoxEdit.ItemsSource) if(objs.Contains(item.EditValue)) list.Add(item); e.ComboBoxEdit.ItemsSource = list; } ... public class MyTableView : TableView { public object[] GetUniqueColumnValues(GridColumn column, bool includeFilteredOut) { return DataProvider.GetUniqueColumnValues(column, includeFilteredOut, true); } } ...

    Hope this helps.
    Best regards, Alan.
    R&D, .NET Team.

    ?
    Unknown 15 years ago

      Thanks so much Alan for the confirmation and the code, i found it is so useful ;)
      Best,
      Longchrea NEAK

      DevExpress Support Team 15 years ago

        Hello,
        I'm glad to be of help! Please feel free to contact us in case of any difficulty - we'll be happy to help you.
        Best regards, Alan.
        R&D, .NET Team.

        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.