Ticket T924735
Visible to All Users

Winform Spreadsheet control: How to get cell address

created 5 years ago

I am working with spread sheet control in winform project. when we work with spread sheet control then how could i get cell address Like A10 AB5.

I also use EPPlus. providing column and row number we can get cell address from EPPlus this way worksheet.Cells[row, (col + 2)].Address;
how to achieve the same with spread sheet control?

provide a code sample. thanks

Answers approved by DevExpress Support

created 5 years ago

Hello,

It seems you already asked this question in your other ticket: How to get cell address or selected cell address.
Did you encounter any difficulties implementing this solution?

    Show previous comments (2)

      HI,

      I asked for sample code. I said I use sheet control this way worksheet.Cells[row, (col + 2)]

      But when I type after GetReferenceA1 then not getting visible this function. So please give me sample code where I can get cell address by cell coordinate like row and column number specification.

      If you do not know what code should be use then please escalate this issue to some one else which can provide code. Sample. It was just totally wastage of time discussing this issue over mail after mail. So hand over my issue to some one who is expert in code. Hope I am clear what I am looking for.

      Thanks
      Tridip

        Does this code will work ?

        Range range = sheet[CurrentRow, collumIndex5Q];
        range.GetReferenceA1();

        i am not before dev pc.

        DevExpress Support Team 5 years ago

          Hi Tridip,

          We are here to assist you solve the task using our components with the help of our documentation and code examples on our site. The Range.GetReferenceA1() Method article clearly illustrates how to obtain a cell reference for a cell or a cell range. If it is not so, please describe the problematic place. I will pass your notes to our technical writers to extend the article accordingly.

          Does this code will work ?

          C#
          Range range = sheet\[CurrentRow, collumIndex5Q\]; range.GetReferenceA1();

          Yes, if you add a variable to store a value returned by the Range.GetReferenceA1() method into your code snippet, it will have a cell address.

          >>But when I type after GetReferenceA1 then not getting visible this function.<<
          It looks strange that Visual Studio Intellisense does not show the GetReferenceA1 method for the Range object on your side. This works as expected on my side (see the video attached).
          Please check if you add the DevExpress.Spreadsheet namespace to the using section in your project.

          C#
          using DevExpress.Spreadsheet;

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.