Spread for ASP.NET 8.0 Product Documentation
IsAnyCellInRowSelected Method (DefaultSheetSelectionModel)
Example 


Row to check
Determines whether any cell in a specified row is in the selection.
Syntax
'Declaration
 
Public Overrides Function IsAnyCellInRowSelected( _
   ByVal row As Integer _
) As Boolean
'Usage
 
Dim instance As DefaultSheetSelectionModel
Dim row As Integer
Dim value As Boolean
 
value = instance.IsAnyCellInRowSelected(row)
public override bool IsAnyCellInRowSelected( 
   int row
)

Parameters

row
Row to check

Return Value

true if any cell in the specified row is selected; false otherwise
Example
This example uses a DefaultSheetSelectionModel as the SelectionModel of the spreadsheet. A selection is added to object, and then several of the methods and properties are set and the values returned to a list box. The selection can be removed in a button click event.
private void Page_Load(object sender, System.EventArgs e)
{
   if (this.IsPostBack) return;

 FpSpread1.ActiveSheetView.ColumnCount = 8;
 FpSpread1.ActiveSheetView.RowCount = 10;
 FpSpread1.ActiveSheetView.SelectionBackColor = Color.Yellow;
 FarPoint.Web.Spread.Model.ISheetSelectionModel model = FpSpread1.ActiveSheetView.SelectionModel;
 
 bool b1, b2, b3;
 int i1;
 model.AddSelection(0, 0, 3, 3);
 b1 = model.IsAnyCellInColumnSelected(2);
 b2 = model.IsAnyCellInRowSelected(2);
 b3 = model.IsSelected(1,1);
 i1 = model.Count;
 ListBox1.Items.Add(Convert.ToString(b1));
 ListBox1.Items.Add(Convert.ToString(b2));
 ListBox1.Items.Add(Convert.ToString(b3));
 ListBox1.Items.Add(Convert.ToString(i1));
}

private void Button1_Click(object sender, System.EventArgs e)
{
 FarPoint.Web.Spread.Model.ISheetSelectionModel model = FpSpread1.Sheets[0].SelectionModel;
 model.RemoveSelection(0, 0, 3, 3);
}
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
   If (IsPostBack) Then Return

   Dim b1, b2, b3 As Boolean
   Dim i1 As Integer
   FpSpread1.ActiveSheetView.ColumnCount = 8
   FpSpread1.ActiveSheetView.RowCount = 10
   FpSpread1.ActiveSheetView.SelectionBackColor = Color.Yellow
   Dim model As FarPoint.Web.Spread.Model.ISheetSelectionModel = FpSpread1.Sheets(0).SelectionModel
   model.AddSelection(0, 0, 3, 3)
   b1 = model.IsAnyCellInColumnSelected(2)
   b2 = model.IsAnyCellInRowSelected(2)
   b3 = model.IsSelected(1,1)
   i1 = model.Count
   ListBox1.Items.Add(b1)
   ListBox1.Items.Add(b2)
   ListBox1.Items.Add(b3)
   ListBox1.Items.Add(i1)

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
   Dim model As FarPoint.Web.Spread.Model.ISheetSelectionModel = FpSpread1.Sheets(0).SelectionModel
   model.RemoveSelection(0, 0, 3, 3)
End Sub
Requirements

Target Platforms: Windows 7, Windows 8, Windows Vista, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

Reference

DefaultSheetSelectionModel Class
DefaultSheetSelectionModel Members
IsAnyCellInRowSelected Method
IsSelected Method

 

 


Copyright © GrapeCity, inc. All rights reserved.