Spread for ASP.NET 12 Product Documentation
Adding a Tag to a Cell
Spread for ASP.NET 12 Product Documentation > Developer's Guide > Customizing User Interaction > Customizing Interaction with Cells > Adding a Tag to a Cell

You can add a tag to a cell or range of cells. If you prefer, you can associate data with any cell in the spreadsheet, or the cells in a column, a row, or the entire spreadsheet. The string data can be used to interact with a cell or to provide information to the application you create. The cell data, or cell tag, is similar to item data you can provide for the spreadsheet, columns, or rows.

For more information on tags, refer to the Tag property in the Cell class.

Using the Properties Window

  1. At design time, in the Properties window, select the FpSpread component.
  2. Select the Sheets property.
  3. Click the button to display the SheetView Collection Editor.
  4. Select the Cells drop-down.
  5. Select the cells for which you want to set the tag.
  6. Set the Tag property.
  7. Select OK.

Using a Shortcut

Set the Tag property for the cells in the sheet of the component.

Example

This example code sets the Tag property for a range of Cell objects.

C#
Copy Code
FpSpread1.Sheets[0].Cells[1, 1, 3, 3].Tag = "This is the tag that describes the value.";
FpSpread1.Sheets[0].Cells[1, 1, 3, 3].Value = "Value Here"; 
VB
Copy Code
FpSpread1.Sheets(0).Cells(1, 1, 3, 3).Tag = "This is the tag that describes the value."
FpSpread1.Sheets(0).Cells(1, 1, 3, 3).Value = "Value Here" 

Using Code

Set the Tag property for the Cell object for a range of cells.

Example

This example code sets the Tag property for a range of Cell objects.

C#
Copy Code
FarPoint.Web.Spread.Cell range1;
range1 = fpSpread1.ActiveSheetView.Cells[1, 1, 3, 3];
range1.Value = "Value Here";
range1.Tag = "This is the tag."; 
VB
Copy Code
Dim range1 As FarPoint.Web.Spread.Cell
range1 = fpSpread1.ActiveSheetView.Cells(1, 1, 3, 3)
range1.Value = "Value Here"
range1.Tag = "This is the tag." 

Using the Spread Designer

  1. In the work area, select the cell or cells for which you want to set the tag to display.
  2. In the properties list (in the Misc group), select the Tag property and type in the text.

    Another way is to select the Cells property and click on the button to display the Cell, Column, and Row editor and select the cells in that editor.

  3. From the File menu choose Apply and Exit to apply your changes to the component and exit Spread Designer.