Home - Forums-.NET - FlyGrid.Net (Windows Forms) - Getting Value of Selected Node

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

Getting Value of Selected Node
Link Posted: 29-Jan-2007 07:42
I am having trouble getting values out of the selected node. How is this done?


NodeBase^ removeNode = dynamic_cast(fgStopList->Selected->Value); //no good

Object^ removeNode = dynamic_cast(fgStopList->Selected->Value);
System::Array^ removeString = dynamic_cast(removeNode);
stopheadwords->Remove(removeString[0]);
//no good
Link Posted: 29-Jan-2007 10:59
To get value associated with the selected node:
[c#]
NodeBase node = fgStopList.Selected;//get the selected node
object value = node.Value; //get value associated with a node
//extract object array - cell values
//value can be a some class instance (for example in the case of single column - string value, or integer),
//but in this case value is a array of objects
object[] cellValues = value as object[];
Link Posted: 29-Jan-2007 16:49
Thank you,

Just for the future, if I was using multi select, would you load the result into an array of nodes?:

array node = fgStopList.Selected;
Link Posted: 30-Jan-2007 06:48
When you use multiselect mode you can receive list of selected nodes by using Rows.GetSelection method:
[c#]
NodeBase[] selectedNodes = flyGrid.Rows.GetSelection();