When columns can be moved or hidden use columns mapping features of FlyGrid.
[list]
If you want to find column at certain visible cell index, use Columns.VisibleColumns[columnIndex].[/*:m]
If you want to find index of field value in the array of values by column value or it's fieldName, use Columns.FieldMapIndexOf(column.FieldName) or Columns.FieldMapIndexOf(column) methods.
Index of field value in the array of node values doesn't restructured when column moved or comes unvisible, internal columns map is restructured to point real index of field value associated with some FieldName.
It will more better if you'll use direct way:
private SetValue(NodeBase node, Column col, object value)
{
node[col] = value;
}
private SetValue(NodeBase node, string fieldName, object value)
{
node[fieldName] = value;
}
[/*:m]
If you want to get value from some visible cell, you can combine these methods:
private SetValue(FlyGrid flyGrid, NodeBase node, int cellIndex, object value)
{
Column col = flyGrid.Columns.VisibleColumns[cellIndex];
node[col] = value;
}
[/*:m][/list:u]