New Posts New Posts RSS Feed: Coloring Columns in a GridBuilder
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Coloring Columns in a GridBuilder

 Post Reply Post Reply
Author
HFloyd View Drop Down
Groupie
Groupie


Joined: 27-Jul-2007
Location: United States
Posts: 44
Post Options Post Options   Quote HFloyd Quote  Post ReplyReply Direct Link To This Post Topic: Coloring Columns in a GridBuilder
    Posted: 27-Aug-2008 at 11:42am
Hello,

I have an entity called HouseholdBusiness which is related to Person (1-many people belong to a HouseholdBusiness). The PersonGridView includes some related columns from HouseholdBusiness:


AddId(descriptors.PersonGUID, "ID");
            AddNameReadOnly(descriptors.FirstName, "First");
            AddNameReadOnly(descriptors.MiddleName, "Middle");
            AddNameReadOnly(descriptors.LastName, "Last");
            AddNameReadOnly(descriptors.Title, "Title");
            AddNameReadOnly(descriptors.HouseholdBusiness.HBType.HBType, "Type");
            AddNameReadOnly(descriptors.HouseholdBusiness.HBName, "House/Biz");
            AddNameReadOnly(descriptors.HouseholdBusiness.City, "City");
            AddNameReadOnly(descriptors.HouseholdBusiness.State, "State");
            AddNameReadOnly(descriptors.HouseholdBusiness.Country, "Country");


The AllPeopleSearcher uses only the actual Person properties for searching:


public AllPeopleSearcher() : base()
        {
            SetContainsQueryTextColumns(
              Person.LastNameEntityColumn
              , Person.FirstNameEntityColumn
              , Person.MiddleNameEntityColumn
              , Person.TitleEntityColumn
              );
        }


I would like to use a visual cue so the user knows they are only searching certain types of data, though the other data is displayed. I thought a column color for the searched fields would be good, but am unsure how to implement this.

The DevExpress website has a code example for coloring a column:

gridView1.Columns["UnitPrice"].AppearanceCell.BackColor = Color.LightSteelBlue;
gridView1.Columns["UnitPrice"].AppearanceCell.BackColor2 = Color.Azure;
gridView1.Columns["UnitPrice"].AppearanceCell.ForeColor = Color.Black;



But since this is CAB, I don't have a direct reference to the gridview here. How/where can I implement code to achieve this result?

Thanks!
Heather
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down