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 7551189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:25:02+00:00 2026-05-30T10:25:02+00:00

I have a DevExpress GridView whose cells are painted with a random color based

  • 0

I have a DevExpress GridView whose cells are painted with a random color based on some condition. Now each color has a meaning and I want to show it as a legend. Number of colors used for each condition may vary.

How can I do this. Please help.

I’m using DevExpress 2009 Vol2, and .Net framework – 2.0 and WinForms

  • 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-05-30T10:25:03+00:00Added an answer on May 30, 2026 at 10:25 am

    You might try using another GridControl. DataSource would be this simple class:

    class Legend
    {
        public Legend(string caption, Color color)
        {
            Caption = caption;
            Color = color;
        }
    
        public string Caption { get; set; }
        public Color Color { get; set; }
    }
    

    You would populate it while building your color list; I don’t know your setup so, for example,

    gridControl1.DataSource = new List<Legend> 
    {
        new Legend ( "First", Color.AliceBlue), 
        new Legend ( "Second", Color.Azure), 
        new Legend ( "Third", Color.Bisque) 
    };
    

    GridControl would have two columns, first one for Color and second for Caption. You must set ColumnEdit property of first column to ColorEdit. In order to avoid color name being displayed set AppearanceCell’s ForeColor property to transparent. Also set FixedWidth in OptionsColumn to true and Width to some nice number (32 for my system).

    View should be uneditable (OptionsBehavior.Editable = false) and focus should not use it’s own appearance (OptionsSelection.EnableAppearanceFocusedRow = false). Additionally, you might hide header, hide row indicators, disallow GridControl from receiving focus etc.

    I hope this helps, even if it arrives two weeks late.

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

Sidebar

Related Questions

I have a devexpress gridview within my asp.net page which has a filter row.
I have a devexpress grid: each row has a checkbox and a text column,
I have a Devexpress Gridview . I generated a GridViewCommandColumnCustomButton in that Gridview on
I have a Devexpress Gridview that is linked to a delete, fetch and update
I have a DevExpress GridView bound to an EntityInstantFeedbackSource. The data loads and pages
I am using DevExpress in my winform application, I have a gridview, data entry
I have some DevExpress BarButtonItem layered on top of one another. So I need
I have got a devexpress gridview with Selection Enabled. Is it possible that, on
i am using devexpress gridview 9.2. i have 2 gridview having 2 colum -->
I Have a UserControl called TenantList.ascx which contains a slightly modified GridView from DevExpress

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.