Home - Forums-.NET - FlyGrid.Net (Windows Forms) - Set Cell Visualization (Font, Color, BkColor...)

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

Set Cell Visualization (Font, Color, BkColor...)
Link Posted: 15-Jan-2006 20:14
Hi,

Is there a way to set the visualization (Font, Color, BkColor) of a single Cell, even if it's in binded mode?

thanks.
Link Posted: 16-Jan-2006 02:47
You can use techniques that described in the Virtual Grid sample (Styled Nodes or CustomDraw Nodes mode)
Link Posted: 17-Jan-2006 22:43
in those exampels you show how to determine the visualization of a whole row.

i need the posibility to do the same thing on each cell

please help,
Guy
Link Posted: 18-Jan-2006 11:14
Yes, but you can easily modify code of these types of nodes to change the colors for the specified columns:

[c#]
internal class StyledVirtualNode : VirtualNode, IStyledNode
{
  public StyledVirtualNode(NodeBase parent) : base(parent){}
  public void OnBeginPaint(CellDrawInfo info)
  {
    if (info.currentColumn.FieldName == "Marker" && this[info.currentColumn] != null)
    {
      if (info.cellSelected)
      {
        info.customForeColor = SystemColors.Info;  
      }
      else
      {
        info.customForeColor = Color.Gray;
        info.customBackColor = Color.LightCyan;
      }
    }
  }

  public void OnEndPaint(CellDrawInfo info)
  {
    if (info.customForeColor != Color.Empty)
    { //clear custom info
      info.customForeColor = Color.Empty;
      info.customBackColor = Color.Empty;
    }
  }
}


Also you can see the Grid Stylizing sample for the Custom Drawn Column, that displays currency type of data in the three colors: zeros in Green, negatives in Red and positive values in the default color.
Link Posted: 23-Jan-2006 10:26
Hi,

I have the same problem and I try to understand the virtual mode but I don't know how to use/link the class you defined...

The problem is also that the VB samples seems not to work...

Thanks

Roberto
Link Posted: 24-Jan-2006 09:02
This problem was discussed several times in this forum, please try to search this support board on 'custom draw' key word to find examples how to use custom draw nodes in Vb.Net.
For example: see this topic