Xceed DataGrid for Silverlight Documentation
BeginGetSelectedItems Method (DataGridControl)
Example 


The AsyncCallback delegate to be called when the operation is complete.
An object containing state information for the operation.
Begins the asynchronous retrieval of the selected items.
Syntax
'Declaration
 
Public Function BeginGetSelectedItems( _
   ByVal asyncCallback As AsyncCallback, _
   ByVal asyncState As Object _
) As IAsyncResult
'Usage
 
Dim instance As DataGridControl
Dim asyncCallback As AsyncCallback
Dim asyncState As Object
Dim value As IAsyncResult
 
value = instance.BeginGetSelectedItems(asyncCallback, asyncState)
public IAsyncResult BeginGetSelectedItems( 
   AsyncCallback asyncCallback,
   object asyncState
)

Parameters

asyncCallback
The AsyncCallback delegate to be called when the operation is complete.
asyncState
An object containing state information for the operation.

Return Value

An IAsyncResult representing the result of the operation.
Example
Private Sub GetSelectedItems()
   Dim result As IAsyncResult = Me.sldgDataGridControl.BeginGetSelectedItems( New AsyncCallback( AddressOf Me.ProcessSelectedItems ), Nothing )
   If( result.IsCompleted ) Then
      Dim selectedItems As IEnumerable( Of Object ) = Me.sldgDataGridControl.EndGetSelectedItems( result )
   End If
End Sub
 
Private Sub ProcessSelectedItems( ByVal result As IAsyncResult )
   If( result.CompletedSynchronously ) Then
      Return
   End If
   Dim selectedItems As IEnumerable( Of Object )  = Me.sldgDataGridControl.EndGetSelectedItems( result )
End Sub
private void GetSelectedItems()
{
   IAsyncResult result = this.sldgDataGridControl.BeginGetSelectedItems( new AsyncCallback( this.ProcessSelectedItems ), null );
   if( result.IsCompleted )
      IEnumerable<object> selectedItems = this.sldgDataGridControl.EndGetSelectedItems( result );
}
 
private void ProcessSelectedItems( IAsyncResult result )
{
   if( result.CompletedSynchronously )
      return;
   IEnumerable<object> selectedItems = this.sldgDataGridControl.EndGetSelectedItems( result );
}
Requirements

Target Platforms: Windows 7, Windows Vista, Windows XP SP3, Windows Server 2008 family

See Also

Reference

DataGridControl Class
DataGridControl Members

Manipulating Data

Selecting Data

Send Feedback