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
160
Add list of filtering using Colors in WinGrid
posted

Hi,

Is there a way that you can include in the Filter dropdown the colors of the grid? I want it to be only in specific column only. Example I have a Column (col1) and I want to put colors on the data in this column and then i want it to filter it by color by choosing on the Filter dropdown. is there any way for this?

Thanks and Regards;

Jerah

Parents
No Data
Reply
  • 18495
    Suggested Answer
    posted

    Hello Jerah,

    Thank you for contacting Infragistics.

    I've attached a sample project that demonstrates how to get the behavior you're looking for.  You need to handle the UltraGrid.AfterRowFilterDropDownPopulate and UltraGrid.FilterRow events.

    In the AfterRowFilterDropDownPopulate event you need to remove the items from e.ValueList.ValueListItems that correspond to the cell values and add new items that correspond to the colors.  For each item you add, set its DataValue to the ARGB value of the color.

    In the FilterRow event, compare the ARGB value of the background color of the row being filtered to the CompareValue of the current filter condition.  If they match, set e.RowFilteredOut to false.  If they don't match, set e.RowFilteredOut to true.

    Please let me know if you have any other questions about this.

    FilterColorTest.zip
Children