SpreadsheetGear 2010
DisplayReferenceName Property
See Also  Example Send Feedback
SpreadsheetGear.Windows.Forms Namespace > WorkbookView Class : DisplayReferenceName Property

Gets or sets the property which specifies the text to display on each of the "sheet tabs" of the workbook view.

Syntax

Visual Basic (Declaration) 
<CategoryAttribute("Display")>
<DescriptionAttribute("Determines which name or names to display on custom tabs created with the DisplayReference property.")>
<DefaultValueAttribute()>
Public Property DisplayReferenceName As String
C# 
[CategoryAttribute("Display")]
[DescriptionAttribute("Determines which name or names to display on custom tabs created with the DisplayReference property.")]
[DefaultValueAttribute()]
public string DisplayReferenceName {get; set;}

Example

C#Copy Code
/*
         * Demonstrate DisplayReference and DisplayReferenceName usage.
         */
        private void radioButton_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButtonWorkbook.Checked)
            {
                // Change the display reference to a workbook.
                workbookView.DisplayReference = "Book2";
                workbookView.DisplayReferenceName = null;
            }
            else if (radioButtonWorksheet.Checked)
            {
                // Change the display reference to a worksheet and name it.
                workbookView.DisplayReference = "[Book1]Sheet1!A:IV";
                workbookView.DisplayReferenceName = "\"My Worksheet\"";
            }
            else if (radioButtonRange.Checked)
            {
                // Change the display reference to a range and name it.
                workbookView.DisplayReference = "[Book3]Sheet2!A1:C3";
                workbookView.DisplayReferenceName = "\"My Range\"";
            }
            else if (radioButtonDefinedName.Checked)
            {
                // Change the display reference to a defined name and name it.
                workbookView.DisplayReference = "Book2!MyName";
                workbookView.DisplayReferenceName = "\"My Defined Name\"";
            }
            else if (radioButtonMultipleRanges.Checked)
            {
                // Change the display reference to multiple ranges and name them.
                workbookView.DisplayReference = "[Book1]Sheet1!A1:C3,[Book1]Sheet1!4:6,[Book1]Sheet1!D:F";
                workbookView.DisplayReferenceName = "\"My Range1\",\"My Range2\",\"My Range3\"";
            }
        }

Remarks

Use the DisplayReferenceName property in conjunction with the DisplayReference property to specify the text to display on the "sheet tabs" of the workbook view control.

The names are specified as a comma separated list of formulas which return the text to display. Some valid examples include:

  • "\"MySheet1\", \"MySheet2\"" displays "MySheet1" on the first sheet tab and "MySheet2" on the second sheet tab.
  • "[Book1]Sheet1!A1" displays the text in the cell A1 on the first sheet tab.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

Copyright © 2003-2010 SpreadsheetGear LLC. All Rights Reserved.Help Powered by Innovasys   
SpreadsheetGear is a registered trademark of SpreadsheetGear LLC.
Microsoft, Microsoft Excel and Visual Studio are trademarks or registered trademarks of Microsoft Corporation.