Home Forums WinForms controls Xceed Grid for WinForms ForeColor of GroupManagerRow

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #14992 |

    Is there a way to change the forecolor of the GroupManagerRow title depending on the value.

    I have a grid with one group column ‘Description’. Depending on the value of the group column, I want to display the group header ‘ABC – 3 items’ in red and ‘XYZ – 5 items’ in blue.

    Thanks.

    Imported from legacy forums. Posted by rj123 (had 1770 views)

    User (Old forums)
    Member
    Post count: 23064

    You need to get a handle of the specific GroupManagerRow instance, and change its ForeColor property. You can do this when groups are actually added through the GroupAdded event.

    e.g.:

    //At form load
    <i>
    private void Form1_Load(object sender, System.EventArgs e)
    {
    gridControl1.GroupAdded += new GroupAddedEventHandler(gridControl1_GroupAdded);
    }
    </i>
    //Event handler
    <i>
    private void gridControl1_GroupAdded(object sender, GroupAddedEventArgs e)
    {
    if( (e.Group.Title).StartsWith( “Your criteria” ) )
    {
    e.Group.HeaderRows[ 0 ].ForeColor = Color.Green;
    }
    }
    </i>

    Imported from legacy forums. Posted by André (had 2892 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.