This is a migrated thread and some comments may be shown as answers.

Not able to programatically select a row

0 Answers 70 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Arpit
Top achievements
Rank 1
Arpit asked on 14 Nov 2011, 12:09 PM
Hi,

here is the XAML of my radGridView
<telerikGridView:RadGridView Name="grdScope"  ScrollMode="RealTime"   DockPanel.Dock="Bottom" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" CanUserInsertRows="False"  AutoGenerateColumns="False" CanUserSortColumns="False" CanUserFreezeColumns="False" CanUserReorderColumns="False" IsFilteringAllowed="False" CanUserResizeColumns="True" Telerik:StyleManager.Theme="Office_Blue" RowStyle="{StaticResource GridViewRowStyleRow}" ScrollViewer.VerticalScrollBarVisibility="Auto" SelectionMode="Single" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ItemsSource="{Binding}" RowDetailsVisibilityMode="Collapsed" RowIndicatorVisibility="Collapsed" IsReadOnly="True" ShowGroupPanel="False"  AutoExpandGroups="True" RowLoaded="grdScope_RowLoaded" SelectionUnit="FullRow" SelectionChanged="grdScope_SelectionChanged"
 MouseDoubleClick="grdScope_MouseDoubleClick" DataLoadMode="Asynchronous" EnableColumnVirtualization="True" EnableRowVirtualization="False">


I am trying to set selected row programatically like this-

var item = ((IList<Task>) this.grdScope.ItemsSource)[this.SelectedTaskIndex];
this.grdScope.SelectedItem = item;

even when variable item has a non-null value, radGridView's SelectedItem property never changes from null to anything else when this code runs.
Am I doing something wrong?

No answers yet. Maybe you can help?

Tags
GridView
Asked by
Arpit
Top achievements
Rank 1
Share this question
or