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

GridView Selected Item Always Null

1 Answer 366 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mohamed
Top achievements
Rank 1
Mohamed asked on 16 Sep 2014, 08:38 AM
Hi,

I'm using RadGridView as below, when i try to access the currently Selected item it always returns with null.
the grid items source is Data which is observable collection.

it used to work correctly before but yet i don't know what went wrong. any help?

 <telerik:RadGridView Grid.Row="1"  CanUserReorderColumns="False" CanUserResizeRows="False"  Visibility="Hidden" SelectionUnit="FullRow"
            x:Name="grdRequests" IsFilteringAllowed="True" GroupRenderMode="Flat"  ShowGroupPanel="True" ItemsSource="{Binding Data}" AutoGenerateColumns="False"
            DistinctValuesLoading="RadGridView1_DistinctValuesLoading" RowHeight="30" CellValidating="grdRequests_CellValidating"    ScrollViewer.HorizontalScrollBarVisibility="Visible"
            BeginningEdit="grdRequests_BeginningEdit" AddingNewDataItem="grdRequests_AddingNewDataItem" >
    </telerik:RadGridView>
from C#:   grdRequests.SelectedItem always = null

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 17 Sep 2014, 09:21 AM
Hi,

May I ask you when do you try to access the SelectedItem? Generally, you can subscribe for the SelectionChanged event of RadGridView and monitor when the SelectedItem is set. Is the SelectedItem correctly set as this event is raised?

Regards,
Dimitrina
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
GridView
Asked by
Mohamed
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or