I have a bound sdDatagrid control and have set the selectionmode to Multiple but I only want to 2 items to be selected.
Private Sub SfDataGrid2_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles SfDataGridOriginalWP.SelectionChanged
'//Can Only be two sequential Items
If CType(sender, SfDataGrid).SelectedItems.Count > 2 Then
CType(sender, SfDataGrid).SelectedItems.RemoveAt(0)
End If
End Sub
This I thought would do the trick and remove the 1st item in the collection if it went over resulting in a FIFO type of collection but although the selectedItems reflects only 2 items - the control still highlights and displays all the selected items. So there appears to be a mismatch between what is showing in the control and what the data is behind the scenes is showing.
Any suggestions or better ways of handling only allowing a specific number of items to be selected.