Home - Forums-.NET - FlyGrid.Net (Windows Forms) - Can't check nodes

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

Can't check nodes
Link Posted: 02-Nov-2005 22:45
Hellow

I use version 1.25. I use hirarchy columns.
i define:


myGrid.ShowCheckBoxes = true;
myGrid.VirtualMode = true;


I see all the nodes in the tree and a checkbox for each node but i can't check the node (i click on the CheckBox but it's not checked)

Can you help me solve this problem?
Link Posted: 03-Nov-2005 01:36
In this case you should provide addtional code in the FlyGrid.VirtualMode_InitNewNode event handler and init node:
[c#]
private ArrayList checkedIndexes = new ArrayList();
//Init FlyGrid
private void InitGrid(FlyGrid flyGrid)
{
  checkedIndexes.Clear();//clear list of checked nodes
  flyGrid.VirtualMode_InitNewNode += new InitNewNodeHandler(flyGrid_VirtualMode_InitNewNode);
  flyGrid.NodeCheckedChange += new NodeHandler(flyGrid_NodeCheckedChange);
//......contiinue initialization
}

private NodeBase flyGrid_VirtualMode_InitNewNode(object sender, NodeBase parent, int index)
{
  //create TreeViewNode that supports checkboxes
  NodeBase newNode = new TreeViewNode(parent);
  newNode.Checked = IsChecked(index);
}

private bool IsChecked(int index)
{
  //here you should answer on question - checked node at index or not.
  return checkedIndexes.Contains(index);
}

//monitor Checked state changes
private void flyGrid_NodeCheckedChange(object sender, NodeBase node)
{
  if (node.Checked)
    checkedIndexes.Add(node.Index);
  else
    checkedIndexes.Remove(node.Index);
}

Link Posted: 09-Nov-2005 04:43
it doesnt solve the problem..
and after using this code, my nodes dissapeared from the tree..
Link Posted: 09-Nov-2005 07:45
A little bit later I'll place sample that shows this possibility.
Link Posted: 09-Nov-2005 16:40
Please download latest FlyGrid update and try the Virtual Nested Grids sample
This sample shows how to organize nested grids and work with checkboxes in virtual mode.