Home - Forums-.NET - FlyGrid.Net (Windows Forms) - Value of selected cell

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

Value of selected cell
Link Posted: 24-Apr-2007 05:43
How do I retrieve the value of the currently selected cell?  I thought this would be easy, but I keep on running into more and more problems with nested columns, hidden columns, etc.
Link Posted: 24-Apr-2007 07:10
To retireve value of selected cell Use one of NodeBase.GetCellValue methods.
Link Posted: 24-Apr-2007 07:39
How do I know which column is selected?  What if the selected cell is in a nested grid?

I also can't use Columns.CurrentColumn because it doesn't work for nested grids.
Link Posted: 02-May-2007 20:39
How do I know which column is selected?
What if the selected cell is in a nested grid?
I also can't use Columns.CurrentColumn because it doesn't work for nested grids.

[c#]
//get selected node
NodeBase selected = flyGrid.Selected;
//retreive port contaning node
FlyGridViewPort port = flyGrid.GetPort(selected);
//retreive focused column from columns associated with port
int columnIndex = port.Columns.CurrentColumn;
Link Posted: 04-May-2007 02:25
Your code didn't work when there were invisible columns... here's what I ended up doing:

NodeBase selected = flyGrid.Selected;
FlyGridViewPort viewPort = flyGrid.GetPort(selected);
int viewColumnIndex = viewPort.Columns.CurrentColumn;
Column column = viewPort.Columns.GetColumnFromCellIndex(viewColumnIndex);
return column.CurrentValue.ToString();
Link Posted: 04-May-2007 05:04
Thanks, please provide more details next time for more precise answers.