RowReady Event

Microsoft Office Web Components Visual Basic

RowReady Event

The RowReady event procedure of the Spreadsheet component is called when a ListObject object is loaded into the component, when a single row in a ListObject object is selected, and when the Refresh method of the XmlDataBinding object is called, regardless of the success or failure of that method.

Private Sub Spreadsheet1_RowReady(XDTName As String, RowDataArray As Variant, SelectionStatus As String)

XDTName   Contains the value of the Name property of the ListObject object.

RowDataArray   This parameter contains an array of values from each cell in the selected row when SelectionStatus returns "Standard". The array will be empty when SelectionStatus returns "New" or "None".

SelectionStatus   Contains one of the values described in the following table:

Value Description
New Indicates that the new, or insert row, is selected. The array of values in RowDataArray will be empty.
None Indicates that no row is selected. The array of values in RowDataArray will be empty.
Standard Indicates that an existing row is selected. The array of values in RowDataArray contain values from each cell in the selected row.

Remarks

If this event fires as a result of loading a new XML Spreadsheet file or XML data into the control, the value of the SelectionStatus parameter will be "None". The Spreadsheet component will fire the RowReady event any time the active cell is moved to a different row in a list. The RowReady event will not fire if a user clicks within a selected row, or clicks outside of the list, and then selects multiple rows within the list.

Example

The following example uses the RowReady event procedure to work with the information contained in the event procedure parameters:

    Sub Spreadsheet1_RowReady(XDTName, RowDataArray, SelectionStatus)
Dim strCellData
Dim intItem

	Select Case SelectionStatus
		Case "None"
		Case "New"
		Case "Standard"
				For intItem = 0 to UBound(RowDataArray) - 1
						strCellData = RowDataArray(intItem)
      ' Work with data in cells of selected row here.
				Next
  Case Else
	End Select
End Sub