skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • AI Coding Assistants
    • Embedded Reporting
    • Document Processing Libraries
    • SSO Account Sign-in

    Web

    Kendo UI UI for Angular UI for Vue UI for jQuery KendoReact UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Telerik JustMock

    CMS

    Sitefinity

    AI Productivity Tools

    AI Coding Assistants

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    KendoReact Free VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • Roadmap
    • Release History
  • Docs & Support
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class NameConverter

Converts between zero-based cell indices and Excel A1-style names (e.g., row 0 / column 1 to "B1") for use in formulas and display.

Inheritance
System.Object
NameConverter
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Telerik.Windows.Documents.Spreadsheet.Utilities
Assembly: Telerik.Windows.Documents.Spreadsheet.dll

Syntax

public static class NameConverter

Methods

ConvertCellIndexesToName(Int32, Int32, Int32, Int32)

Formats zero-based row and column indices into an A1-style range name (e.g., "A1:B10").

Declaration
public static string ConvertCellIndexesToName(int fromRowIndex, int fromColumnIndex, int toRowIndex, int toColumnIndex)
Parameters
System.Int32 fromRowIndex

The start row index.

System.Int32 fromColumnIndex

The start column index.

System.Int32 toRowIndex

The end row index.

System.Int32 toColumnIndex

The end column index.

Returns
System.String

The name.

ConvertCellIndexToName(Int32, Int32)

Combines a zero-based row and column index into an A1-style cell name (e.g., row 0, column 1 to "B1").

Declaration
public static string ConvertCellIndexToName(int rowIndex, int columnIndex)
Parameters
System.Int32 rowIndex

Index of the row.

System.Int32 columnIndex

Index of the column.

Returns
System.String

The name.

ConvertCellIndexToName(CellIndex)

Formats a CellIndex into an A1-style cell name (e.g., row 0, column 1 to "B1").

Declaration
public static string ConvertCellIndexToName(CellIndex cellIndex)
Parameters
CellIndex cellIndex

The cell index.

Returns
System.String

The name.

ConvertCellNameToIndex(String, out Boolean, out Int32, out Boolean, out Int32)

Parses an A1-style cell name into zero-based indices and detects absolute reference markers (e.g., "$A$1" sets both flags true).

Declaration
public static void ConvertCellNameToIndex(string cellName, out bool isRowAbsolute, out int rowIndex, out bool isColumnAbsolute, out int columnIndex)
Parameters
System.String cellName

Name of the cell.

System.Boolean isRowAbsolute

The value indicating whether the row is absolute.

System.Int32 rowIndex

Index of the row.

System.Boolean isColumnAbsolute

The value indicating whether the column is absolute.

System.Int32 columnIndex

Index of the column.

ConvertCellNameToIndex(String, out Int32, out Int32)

Parses an A1-style cell name (e.g., "B1") into zero-based row and column indices, throwing on invalid input.

Declaration
public static void ConvertCellNameToIndex(string cellName, out int rowIndex, out int columnIndex)
Parameters
System.String cellName

Name of the cell.

System.Int32 rowIndex

Index of the row.

System.Int32 columnIndex

Index of the column.

ConvertCellRangeToName(CellIndex, CellIndex)

Formats a cell range into an A1-style name (e.g., "A1:B10"), detecting full-row or full-column ranges.

Declaration
public static string ConvertCellRangeToName(CellIndex fromIndex, CellIndex toIndex)
Parameters
CellIndex fromIndex

From index.

CellIndex toIndex

To index.

Returns
System.String

The name.

ConvertCellRangeToName(CellRange)

Formats a CellRange into an A1-style name (e.g., "A1:B10"), detecting full-row or full-column ranges.

Declaration
public static string ConvertCellRangeToName(CellRange range)
Parameters
CellRange range

The range.

Returns
System.String

The name.

ConvertCellReferenceRangeToName(CellReference, CellReference)

Formats a range defined by two CellReferences into an A1-style name, preserving absolute markers (e.g., "$A$1:$B$10").

Declaration
public static string ConvertCellReferenceRangeToName(CellReference fromCellReference, CellReference toCellReference)
Parameters
CellReference fromCellReference

The start cell reference.

CellReference toCellReference

The end cell reference.

Returns
System.String

The name.

ConvertCellReferenceToName(CellReference)

Formats a CellReference into an A1-style name, preserving absolute reference markers (e.g., $A$1).

Declaration
public static string ConvertCellReferenceToName(CellReference cellReference)
Parameters
CellReference cellReference

The cell reference.

Returns
System.String

The name.

ConvertColumnIndexToName(Int32)

Converts a zero-based column index to its Excel alphabetic column name (e.g., 0 to "A", 25 to "Z", 26 to "AA").

Declaration
public static string ConvertColumnIndexToName(int columnIndex)
Parameters
System.Int32 columnIndex

Index of the column.

Returns
System.String

The name.

ConvertColumnNameToIndex(String)

Parses an Excel alphabetic column name (e.g., "A", "Z", "AA") to a zero-based column index, throwing on invalid input.

Declaration
public static int ConvertColumnNameToIndex(string columnName)
Parameters
System.String columnName

Name of the column.

Returns
System.Int32

The index.

ConvertRowIndexToName(Int32)

Converts a zero-based row index to its 1-based Excel row name (e.g., 0 to "1", 999 to "1000").

Declaration
public static string ConvertRowIndexToName(int rowIndex)
Parameters
System.Int32 rowIndex

Index of the row.

Returns
System.String

The name.

ConvertRowNameToIndex(String)

Parses a 1-based Excel row name (e.g., "1", "1000") to a zero-based row index, throwing on invalid input.

Declaration
public static int ConvertRowNameToIndex(string rowName)
Parameters
System.String rowName

Name of the row.

Returns
System.Int32

The index.

IsValidA1CellName(String)

Validates whether a string is a valid A1-style cell name (e.g., "A1", "$B$10") within worksheet bounds.

Declaration
public static bool IsValidA1CellName(string cellName)
Parameters
System.String cellName

Name of the cell.

Returns
System.Boolean

The value indicating whether the name of the cell is valid.

TryConvertCellNameToIndex(String, out Boolean, out Int32, out Boolean, out Int32)

Tries to parse an A1-style cell name into indices and absolute flags, returning false if invalid.

Declaration
public static bool TryConvertCellNameToIndex(string cellName, out bool isRowAbsolute, out int rowIndex, out bool isColumnAbsolute, out int columnIndex)
Parameters
System.String cellName

Name of the cell.

System.Boolean isRowAbsolute

The is row absolute.

System.Int32 rowIndex

Index of the row.

System.Boolean isColumnAbsolute

The is column absolute.

System.Int32 columnIndex

Index of the column.

Returns
System.Boolean

TryConvertCellNameToIndex(String, out Int32, out Int32)

Tries to parse an A1-style cell name (e.g., "B1") into zero-based indices, returning false if invalid or out of range.

Declaration
public static bool TryConvertCellNameToIndex(string cellName, out int rowIndex, out int columnIndex)
Parameters
System.String cellName

Name of the cell.

System.Int32 rowIndex

Index of the row.

System.Int32 columnIndex

Index of the column.

Returns
System.Boolean

The value indicating whether the conversion was successful.

TryConvertCellRangeNameToCellRange(String, out CellRange)

Tries to parse an A1-style range name (e.g., "A1:B10", "1:5", "A:C") into a CellRange, returning false if invalid.

Declaration
public static bool TryConvertCellRangeNameToCellRange(string name, out CellRange cellRange)
Parameters
System.String name

The cell range name.

CellRange cellRange

The CellRange instance.

Returns
System.Boolean

True if successful, otherwise False.

TryConvertNamesToCellReferenceRangeExpression(String, Worksheet, Int32, Int32, out CellReferenceRangeExpression)

Parses a cell range name string (e.g., "A1:B10") into a CellReferenceRangeExpression relative to the specified cell position, returning false if invalid.

Declaration
public static bool TryConvertNamesToCellReferenceRangeExpression(string cellRangesNames, Worksheet worksheet, int rowIndex, int columnIndex, out CellReferenceRangeExpression expression)
Parameters
System.String cellRangesNames

The cell ranges names.

Worksheet worksheet

The worksheet.

System.Int32 rowIndex

The row index of the cell for which the expression is created.

System.Int32 columnIndex

The column index of the cell for which the expression is created.

CellReferenceRangeExpression expression

The expression.

Returns
System.Boolean

True if converter successfuly, else false.

Getting Started
  • Getting Started
Support Resources
  • Documentation
Community
  • Forums
  • Blogs
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.