The features in this topic are available only if you have the required applications installed.
For more information, see.
Thecontrol is a range that has a unique name, exposes events and can be bound to data. When you add a named range to a worksheet, Microsoft Visual Studio 2005 Tools for the Microsoft Office System creates a named range control that you can program against directly without having to traverse the Microsoft Office Excel 2003 object model.
Creating the Control
You can create a NamedRange control from within Excel or Visual Studio. For more information, see.
NamedRange controls can only consist of ranges on specific sheets. NamedRange controls cannot have relative names that apply to all sheets, and they cannot consist of ranges that span two or more worksheets in a workbook (3-D ranges).
Binding Data to the Control
A named range would appear to be a good candidate for complex data binding since it can have many cells; however, a range is merely a collection of cells that cannot be easily mapped to a particular column from a dataset. Therefore, NamedRange controls only support simple data binding. Thecontrol can be used for complex data binding. For more information, see .
The NamedRange control can be bound to a data source using theproperties. The default data binding property of the NamedRange control is .
If the data in the bound dataset is updated through any mechanism, the NamedRange control reflects the changes.
Formatting that can be applied to acan be applied to a Microsoft.Office.Tools.Excel.NamedRange control. This includes borders, fonts, number format and styles.
Renaming the Control
When you add a NamedRange control to your worksheet from the toolbox, Visual Studio Tools for Office automatically generates a name for the control. You can change the name in the Properties window.
The events available for the NamedRange control are: