Home - Forums-.NET - FlyGrid.Net (Windows Forms) - NodeSelectedChange event and multiselect

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

NodeSelectedChange event and multiselect
Link Posted: 16-Jun-2006 02:43
If MultiSelect is on, the NodeSelectedChange-event no longer gets triggered. Is this by design??
Link Posted: 16-Jun-2006 13:09
Yes, FlyGrid.NodeSelectedChange event used in single-selection mode, with multiselection use FlyGrid.SelectionChanged event.

private void InitFlyGrid(FlyGrid flyGrid)
{
  //....
  //....
  flyGrid.SelectionChanged += new System.EventHandler(flyGrid_SelectionChanged);
}

private void flyGrid_SelectionChanged(object sender, EventArgs e)
{
  if (flyGrid.Rows.HasSelection)
  {
    System.Diagnostics.WriteLine(\"flyGrid_SelectionChanged: GetSelection.Length=\" + flyGrid.Rows.GetSelection().Length);
    if (flyGrid.Selected == null)
    {
      System.Diagnostics.WriteLine(\"flyGrid_SelectionChanged: flyGrid.Selected is null\");
    }
    else
    {
      System.Diagnostics.WriteLine(\"flyGrid_SelectionChanged: Current Selection:\");
      System.Diagnostics.WriteLine(\"--------------------------------------------\");
      foreach (NodeBase node in flyGrid.Rows.GetSelection())
      {
        System.Diagnostics.WriteLine(node[0].ToString());
      }
      System.Diagnostics.WriteLine(\"--------------------------------------------\");
    }
  }
  else
  {
    System.Diagnostics.WriteLine(\"flyGrid_SelectionChanged:FlyGrid has no selection\");
  }
}
Link Posted: 19-Jun-2006 03:53
Thanks, that worked.