Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8207617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:03:28+00:00 2026-06-07T09:03:28+00:00

Using Infragistics UltraGrid in WinForms in C#: I am conditionally changing the color of

  • 0

Using Infragistics UltraGrid in WinForms in C#:

I am conditionally changing the color of the ForeColor of some GroupByRows on a grid. When the user clicks the row, the color changes back to the active/selected/hot tracked/whatever color until they click on something else. I’d like the text color of the rows that I have conditionally colored to never change. Here’s how I’m setting the color:

Row.Appearance.ForeColor = System.Drawing.Color.Orange;

Any idea how to make it stick even when the row is clicked?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T09:03:31+00:00Added an answer on June 7, 2026 at 9:03 am

    This can be done with a draw filter to set the fore color of the description since this would apply at all times.

    A simple example is the following draw filter which will make all group by rows that have an integer value that is even orange:

    public class GroupByRowDrawFilter:IUIElementDrawFilter
    {
        public bool DrawElement(DrawPhase drawPhase, ref UIElementDrawParams drawParams)
        {
            GroupByRowDescriptionUIElement element = (GroupByRowDescriptionUIElement)drawParams.Element;
            if (element.GroupByRow.Value is int)
            {
                int value = (int)element.GroupByRow.Value;
                if (value % 2 == 0)
                {
                    drawParams.AppearanceData.ForeColor = Color.Orange;
                }
            }
    
            return false;
        }
    
        public DrawPhase GetPhasesToFilter(ref UIElementDrawParams drawParams)
        {
            if (drawParams.Element is GroupByRowDescriptionUIElement)
                return DrawPhase.BeforeDrawElement;
            return DrawPhase.None;
        }
    }
    

    To apply the draw filter use the following line of code:

    this.ultraGrid1.DrawFilter = new GroupByRowDrawFilter();
    

    Note that this approach requires that the condition be in the draw filter. If this doesn’t work for you, you could modify your logic where you are currently setting the ForeColor to set the Tag property of the GroupByRow instead and then check the Tag property in the draw filter to determine if you need to apply your logic.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to create a winforms grid with 3 levels, using infragistics ultragrid. Level
I am using an Infragistics UltraGrid in a WinForms application. Which event is raised
We're using Infragistics grid (most probably, we'll have 8.2 version at the end) and
I am using the Infragistics UltraWebGrid to capture some data. I don't have this
I am using an Infragistics XamDataGrid for my grid. It is bound to an
I am using Infragistics UltraGrid with datasouce Windows Bindingsouce. On change, I provide datasouce
Using the Infragistics UltraGrid (e.g. myGrid ), I want to: Hook an event that
I am using Infragistics 2009 vol 1. My UltraGrid is bound to a BindingList
Infragistics Grid disappears when grid parent element is expanded/collapsed using JavaScript style.display property. When
I'm using an Infragistics grid on a form and am handling multiple client-side events

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.