在telerik RadSpreadSheet中,如何从单元格索引或选择中获取单元名称?

时间:2014-06-19 08:15:44

标签: c# wpf excel telerik spreadsheet

private string GetCellName()
{
    var cell = mySpreadsheet.ActiveWorksheetEditor.Selection.ActiveCell;

    // I expect A1 if active cell is cell[0,0]
    return cell. // What should i call here to get cell name;
}

在WPF应用程序中使用Telerik RadSpreadSheet
我正试图从Selection对象或给定的单元格索引中获取单元格引用(类似于excel应用程序A1,B15,...中的单元名称) 注意:
Telerik understand reference in formulas
there is a class called CellReference

1 个答案:

答案 0 :(得分:2)

NameConverter提供辅助方法,以在单元格或列索引与名称之间进行转换

private string GetCellName()
{
     CellIndex cellIndex = this.radSpreadsheet.ActiveWorksheetEditor.Selection.ActiveCellIndex;
     return NameConverter.ConvertCellIndexToName(cellIndex);
}