Returns an array of
Owner objects that represent the members of the
UltraCalendarInfo.VisibleOwners collection currently being displayed in the viewable area of the control.
'Declaration
Public Function GetOwnersInView() As Owner()
Return Value
An array of
Owner objects, or an empty array if the control is not currently displaying any
Owners.
The following code sample demonstrates how yo use the GetOwnerFromPoint method to find the owner at a specified point in the control's bounds, and how the use the GetOwnersInView method to get the owners that are currently being displayed by the control.
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinSchedule
Private Sub ultraWeekView1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ultraWeekView1.MouseDown
' Use the GetOwnerFromPoint method to get the owner that was clicked, if any
Dim ownerAtPoint As Infragistics.Win.UltraWinSchedule.Owner = Me.ultraWeekView1.GetOwnerFromPoint(e.X, e.Y)
' Use the GetOwnersInView method to get an array of the owners that are
' currently being displayed by the control
Dim ownersInView() As Infragistics.Win.UltraWinSchedule.Owner = Me.ultraWeekView1.GetOwnersInView()
' Get the number of owners currently being displayed by the control
Dim inViewOwnerCount As Int32 = ownersInView.GetLength(0)
Dim msg As String = String.Empty
' Append the noame of the owner that was clicked to the message string
If Not ownerAtPoint Is Nothing Then
msg += ownerAtPoint.Name + " was clicked." + Environment.NewLine
End If
' Append the name of each owner to the message string
msg += "There are currently " + inViewOwnerCount.ToString() + " owners in view:"
msg += Environment.NewLine
Dim i As Int32
For i = 0 To ownersInView.GetLength(0) - 1
msg += ownersInView(i).Name + Environment.NewLine
Next
' DIsplay the information in a message box
MessageBox.Show(msg)
End Sub
'Declaration
Public Function GetOwnersInView() As Owner()
using Infragistics.Win;
using Infragistics.Win.UltraWinSchedule;
using System.Diagnostics;
private void ultraWeekView1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
// Use the GetOwnerFromPoint method to get the owner that was clicked, if any
Infragistics.Win.UltraWinSchedule.Owner ownerAtPoint = this.ultraWeekView1.GetOwnerFromPoint( e.X, e.Y );
// Use the GetOwnersInView method to get an array of the owners that are
// currently being displayed by the control
Infragistics.Win.UltraWinSchedule.Owner[] ownersInView = this.ultraWeekView1.GetOwnersInView();
// Get the number of owners currently being displayed by the control
int inViewOwnerCount = ownersInView.GetLength(0);
string msg = string.Empty;
// Append the noame of the owner that was clicked to the message string
if ( ownerAtPoint != null )
msg += ownerAtPoint.Name + " was clicked." + Environment.NewLine;
// Append the name of each owner to the message string
msg += "There are currently " + inViewOwnerCount.ToString() + " owners in view:";
msg += Environment.NewLine;
for ( int i = 0; i < ownersInView.GetLength(0); i ++ )
{
msg += ownersInView[i].Name + Environment.NewLine;
}
// DIsplay the information in a message box
MessageBox.Show( msg );
}
'Declaration
Public Function GetOwnersInView() As Owner()
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2