SpreadsheetGear 2012
DisplayReference Property (WorkbookView)
Example 






Gets or sets the property which specifies which workbook or set of cell ranges to display in the workbook view.
Syntax
'Declaration
 
<System.ComponentModel.CategoryAttribute("Display")>
<System.ComponentModel.DescriptionAttribute("Determines which workbook or set of custom tabs to display in the control.")>
<System.ComponentModel.DefaultValueAttribute()>
Public Property DisplayReference As System.String
'Usage
 
Dim instance As WorkbookView
Dim value As System.String
 
instance.DisplayReference = value
 
value = instance.DisplayReference
[System.ComponentModel.Category("Display")]
[System.ComponentModel.Description("Determines which workbook or set of custom tabs to display in the control.")]
[System.ComponentModel.DefaultValue()]
public System.string DisplayReference {get; set;}
public read-write property DisplayReference: System.String; 
System.ComponentModel.CategoryAttribute("Display")
System.ComponentModel.DescriptionAttribute("Determines which workbook or set of custom tabs to display in the control.")
System.ComponentModel.DefaultValueAttribute()
public function get,set DisplayReference : System.String
[System.ComponentModel.Category("Display")]
[System.ComponentModel.Description("Determines which workbook or set of custom tabs to display in the control.")]
[System.ComponentModel.DefaultValue()]
public: __property System.string* get_DisplayReference();
public: __property void set_DisplayReference( 
   System.string* value
);
[System.ComponentModel.Category("Display")]
[System.ComponentModel.Description("Determines which workbook or set of custom tabs to display in the control.")]
[System.ComponentModel.DefaultValue()]
public:
property System.String^ DisplayReference {
   System.String^ get();
   void set (    System.String^ value);
}
Remarks

Use the DisplayReference property to specify what should be displayed for each "sheet tab" of the workbook view control.

WorkbookView.DisplayReference takes a comma separated list of formulas which must return a range. These formulas are evaluated each time a calculation completes in the workbook set associated with the workbook view control, by calling the SpreadsheetGear.ISheet.EvaluateRange method of the first worksheet of the first workbook of the workbook set.

Examples of valid settings for DisplayReference include:

Use the WorkbookView.DisplayReferenceName property to specify the text to display on each "sheet tab".

Example
/*
         * 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\"";
            }
        }
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

WorkbookView Class
WorkbookView Members
DisplayReferenceName Property

Send Feedback