IsRowSelected method (DataWindows)
Description
Determines whether a row is selected in a DataWindow. A selected
row is highlighted using reverse video.
Controls
|
DataWindow type |
Method applies to |
|---|---|
|
Web |
Client control |
Syntax
[Web DataWindow client control]
|
1 |
boolean <span>dwcontrol</span><span>.IsSelected</span> ( number <span>row </span>) |
|
Argument |
Description |
|---|---|
|
dwcontrol |
A reference to a DataWindow control, |
|
row |
A value identifying the row you want |
Return Values
Returns true if row in dwcontrol is
selected and false if it is not selected. If row is
greater than the number of rows in dwcontrol or
is 0 or negative, IsRowSelected also returns false.
Usage
You can call IsRowSelected in a script
for the Clicked event to determine whether the row the user clicked
was selected. With IsRowSelected and SelectRow,
you can highlight a row on the client without causing a postback.
Examples
This code calls IsRowSelected to
test whether the clicked row is selected. If the row is selected, SelectRow deselects
it; if it is not selected, SelectRow selects
it:
|
1 |
if (rowNumber > 0)<br>{<br>   if (dw_1.<span>IsRowSelected</span>(rowNumber))<br>      dw_1.SelectRow(rowNumber, false);<br>   else<br>      dw_1.SelectRow(rowNumber, true);<br>} |