I am kind of stumped over this issue I have been scouring your boards in hope of finding a resovle, but nothing has revealed itself.
I have a fairly standard grid, the client picks and item or two and then clicks a button, I do count check and display a message, however everytime I go to do this "RadGridView1.SelectedItems.Count" always equals 0 no matter how many I pick or dont pick. Everything else about the grid seems to be working ok.
Any help would be extremely grateful.
<
UserControl x:Class="IDUser.IDUser"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
xmlns:input="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"
xmlns:grid="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView">
<Grid x:Name="LayoutRoot">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0">
<Controls:RadGridView
x:Name="RadGridView1"
ItemsSource="{Binding}"
SelectionMode="Multiple"
MultipleSelect="True"
IsReadOnly="True"
AutoGenerateColumns="False"
UseAlternateRowStyle="True">
<Controls:RadGridView.Columns>
<Controls:GridViewSelectColumn/>
<Controls:GridViewDataColumn>
<Controls:GridViewDataColumn.Header>
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock Width="150" Text="User" Grid.Column="0" Grid.Row="0" />
<TextBlock Width="150" Text="Account #" Grid.Column="1" Grid.Row="0" />
<TextBlock Width="150" Text="Item" Grid.Column="2" Grid.Row="0" />
</Grid>
</Controls:GridViewDataColumn.Header>
<Controls:GridViewDataColumn.CellTemplate>
<DataTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock Width="150" Text="{Binding CLIENT}" Grid.Row="0" Grid.Column="0" />
<TextBlock Width="150" Text="{Binding ACCTNO}" Grid.Row="0" Grid.Column="1" />
<TextBlock Width="150" Text="{Binding ITEM}" Grid.Column="2" Grid.Row="0" />
</Grid>
</DataTemplate>
</Controls:GridViewDataColumn.CellTemplate>
</Controls:GridViewDataColumn>
</Controls:RadGridView.Columns>
</Controls:RadGridView>
</StackPanel>
<StackPanel Height="30" Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Left" Margin="0 0 0 15">
<telerik:RadButton
Click="Ok_Click"
x:Name="Ok"
Content="Ok"
Width="100"
Height="20"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Margin="300 0 50 0"/>
</StackPanel>
</Grid>
</
UserControl>
Private Sub Ok_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
If RadGridView1.SelectedItems.Count > 1 Then
Dim newmessage As String = "User has selected more than one"
ElseIf RadGridView1.SelectedItems.Count = 0 Then
Dim newmessage As String = "User has selected Nothing"
Else
Dim newmessage As String = "User has selected an item"
End If
End Sub