Sets the current row in a DataWindow control or DataStore.
integer dwcontrol.SetRow ( long row )
Argument |
Description |
---|---|
dwcontrol |
A reference to a DataWindow control, DataStore, or child DataWindow in which you want to set the current row |
row |
The row you want to make current |
Returns 1 if it succeeds and -1 if an error occurs. If row is less than 1 or greater than the number of rows, SetRow fails. If any argument’s value is NULL, the method returns NULL.
SetRow moves the cursor to the current row but does not scroll the DataWindow control or DataStore.
SetRow can trigger these events:
ItemChanged
ItemError
ItemFocusChanged
RowFocusChanged
Avoiding infinite loops
Never call SetRow in the ItemChanged event or any of the other
events listed above. Because SetRow can trigger these events, such
a recursive call can cause a stack fault.
This statement sets the current row in dw_employee to 15:
dw_employee.SetRow(15)
This example unhighlights all highlighted rows, if any. It then sets the current row to 15 and highlights it. If row 15 is not visible, you can use ScrollToRow instead of SetRow:
dw_employee.SelectRow(0, FALSE)
dw_employee.SetRow(15)
dw_employee.SelectRow(15, TRUE)
Copyright © 2004. Sybase Inc. All rights reserved. |
![]() |