Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
585
Different IFilterUIProvider for column
posted

I'd like to use the modern Excel-style filtering UI for most columns. However, I also have some special ones for which my own filter UI already exists.

So, what I'd need to do is set the different filter UI provider depending on the column. As far as I can tell, it can only be set on the DisplayLayout property.

What's the best approach to override this on a per-column basis, e.g. by inheriting UltraGridFilterUIProvider?

  • 469350
    Suggested Answer
    Offline posted

    Hi Sören,

    As far as I can see, there's no simple or easy way to do this. You are correct that FilterUIProvider can only be set on the band and no the column.

    How are you providing your own filter UI now? Did you create your own IFilterUIProvider implementation? If so, you are probably the first person who I've heard of who has done so outside of Infragistics.

    I guess there are two basic approaches you could take here. One would be to try to inherit from UltraGridFilterUIProvider and then override the interface methods for the columns where you want to provide your own custom UI.

    The second option would be to create your own IFilterUIProvider implementation and have it create an UltraGridFilterUIProvider internally and then have the interface call off to the UltraGridFilterUIProvider for the columns where you want it to provide the filtering.

    I suppose a third option would be to write your own filter provider completely from scratch. If you own a subscription with source code, you could start with the UltraGridFilterUIProvider and then modify it directly from there.

    Frankly, though, any approach you take here seems like it will be a tremendous effort and there's no guarantee that it will even be possible to get what you want. The feature was clearly written with the assumption that all of the columns are using the same FilterUIProvider. So it's entirely possible that there are assumptions being made by the grid that will make it impossible to make this work.

    What exactly does your custom FilterUI do?  Perhaps instead of creating a whole new UI, you could using the UltraGridFilterUIProvider and just modify the menus and the list of values a little bit to get something good enough for what you need. The menus and the list are modifiable via the events of the UltraGridFilterUIProvider.

    Sören