Home - Forums-.NET - FlyGrid.Net (Windows Forms) - changing foreground color in lookuplist

FlyGrid.Net (Windows Forms)

.NET Datagrid - Fast, highly customizable, industry standards .NET data grid control for WinForms

This forum related to following products: FlyGrid.Net

changing foreground color in lookuplist
Link Posted: 05-Oct-2005 21:21
Hi,
I'd like to override the lookuplist column and to give a red color to the items in the list only when they are equal to a specific string. Therefore some of the items would be black and some others would be of a different color. Is it possible and if so how can I do that ?

Thanks
Link Posted: 10-Oct-2005 15:17
Yes, it will be possible in the nearest FlyGrid.Net update:
You should override LookupListColumn.PrepareLookupNodes:

protected override NodeBase PrepareLookupNodes()
{
  VirtualRootNode lookupRoot = base.PrepareLookupNodes() as VirtualRootNode;
  lookupRoot.GetNode += new GetNodeHandler(GetNode);
}
private NodeBase GetNode(NodeBase sender, int position)
{
  // here you can provide custom drawn node, as work in the virtual mode -  
  // see the Virtual Grid sample for the different ways of custom drawn nodes
  // usage
}
Link Posted: 12-Oct-2005 01:51
doing so would change the color of the node. I want to customise the color of the text in the list when the list is being 'dropped down':

If the list contains the following items:

item1
item2
item3
special item -> will appear in red
item4
...

Is this possible?
Link Posted: 12-Oct-2005 08:23
May be best solution of this problem is using custom dropdowns?
See the Grid Stylizing Sample, Custom Dropdown column.
In this case you can access to the FlyGrid that will used as dropdown.
Link Posted: 12-Oct-2005 23:09
Yes I am going to override the dropdownlistcolumn control, but the sample isn't clear to me (by the way it does not compile at all in vs2005, there are many errors).

I can't find an event such as dropdownexpanding. How can I operate on the list of the dropdown?

Thanks
Link Posted: 13-Oct-2005 09:13
Unfortunately VS2005 RC/Beta2 is not ready for start development (imo), and delivery some problems - incorrect code serialization for examlpe.

You can open the customStyleGridForm.cs and look at CustomDropdownColumn class - this class implements custom dropdown column functionality.