Xceed DataGrid for Silverlight Documentation
SelectedRanges Property
Example 


Gets the ranges of items that are selected in a grid.
Syntax
'Declaration
 
Public ReadOnly Property SelectedRanges As IList(Of SelectionRange)
'Usage
 
Dim instance As DataGridControl
Dim value As IList(Of SelectionRange)
 
value = instance.SelectedRanges
public IList<SelectionRange> SelectedRanges {get;}

Property Value

A generic IList of SelectionRange objects that represent the item that are selected in a grid.
Example
For more information and examples on selecting data, refer to the Selecting Data topic.
Dim range As New SelectionRange( New SortDescription() { New SortDescription( "ShipVia", ListSortDirection.Ascending ),
                                                         New SortDescription( "OrderDate", ListSortDirection.Ascending )}, Nothing, Nothing )

range.StartRangeInfos.Add( "ShipVia", 2 )
range.StartRangeInfos.Add( "OrderDate", New DateTime( 2006, 01, 01 ) )

range.EndRangeInfos.Add( "ShipVia", 2 )
range.EndRangeInfos.Add( "OrderDate", New DateTime( 2006, 12, 31 ) )

Me.sldgDataGridControl.SelectedRanges.Clear()
Me.sldgDataGridControl.SelectedRanges.Add( range )
SelectionRange range = new SelectionRange( new SortDescription[] { new SortDescription( "ShipVia", ListSortDirection.Ascending ),
                                                                        new SortDescription( "OrderDate", ListSortDirection.Ascending )}, null, null );

range.StartRangeInfos.Add( "ShipVia", 2 );
range.StartRangeInfos.Add( "OrderDate", new DateTime( 2006, 01, 01 ) );

range.EndRangeInfos.Add( "ShipVia", 2 );
range.EndRangeInfos.Add( "OrderDate", new DateTime( 2006, 12, 31 ) );

this.sldgDataGridControl.SelectedRanges.Clear();
this.sldgDataGridControl.SelectedRanges.Add( range );
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