Hi Adrian,
As discussed by email recently, I'd like to enter a wish for a future release of FlexCel.
At the moment, one can only GetCellValue(...) by using row and column numbers. In many use cases, the position of the column is unknown, or is dynamic. For reference for others who might have this use-case, here is the code you suggested I use to create a ColumnMap to get the column position by name:
//Build a dictionary to lookup columns by "name" instead of position
const int headerRow = 1;
var ColumnMap = new Dictionary<string, int>();
{
for (int cIndex = 1; cIndex <= xlsf.ColCountInRow(headerRow); cIndex++)
{
int XF = -1;
var header = xlsf.GetCellValueIndexed(headerRow, cIndex, ref XF);
var headerString = TFlxNumberFormat.FormatValue(header, xlsf.GetFormat(XF).Format, xlsf);
ColumnMap[headerString] = xlsf.ColFromIndex(headerRow, cIndex);
}
}
This works perfectly, but if you accept, it would be nice to have a similar functionality built-in.
Thanks for your help and great support.
Cheers