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

Is Event for SelectedItem with QueryableCollectionView as ItemSource raised on every loaded Item ?

1 Answer 103 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 23 Jun 2018, 11:59 AM

Hallo Telerik , 

i think there is an issue but i am not sure. 

1) i using the RadGridView + QueryableCollectionView as ItemSource 

2) I prepared the Collection i think correctly and Data is shown in the Grid also the paging prev and next works as "expected". 

   Debuging show me that the Property of SelectedUiDataItem ( see part of code below ) is called twice.

   First with Value = NULL and second with a Value != NULL which is the new Item set on the new Page. So i think a normal Condition.

Problem comes after Record is changed ! 

If i start changeing a Record in the Grid and Ending the Change with Return or selecting a different Record. 

On Return (i stay in same record in grid) the SelectedUiDataItem is called several times ( counted 22 ) 

1) Time called with value = null 

2-21) Times called for each Record in the Page 

22) Time called with value = null 

How can this been avoided what have i done wrong because in the SelectedItem Property i do not know which is the "real" current item ( = null) at the End and Updates are failing.

thanks br thomas cinatl

 

<telerik:RadGridView x:Name="LookupListGridCtrl" ItemsSource="{Binding Nodes, Mode=TwoWay}" SelectedItem="{Binding SelectedUiDataItem,Mode=TwoWay}"  Grid.Row="1" 
                             AutoGenerateColumns="false" NewRowPosition="Top" SelectionMode="Single" SelectionUnit="FullRow" 
                             CanUserDeleteRows="True" IsSynchronizedWithCurrentItem="True" CanUserResizeColumns="True" CanUserSearch="True"
                             RowIndicatorVisibility="Visible" Margin="0,0,0,1" ValidationType="Default" 
                             FilteringMode="FilterRow" 
		>

 

           <telerik:EventToCommandBehavior.EventBindings>
                <telerik:EventBinding Command="{Binding CommandProvider.DoDeleteRow}" EventName="Deleted" RaiseOnHandledEvents="True" PassEventArgsToCommand="True" />
                <telerik:EventBinding Command="{Binding CommandProvider.DoUpdateRow}" EventName="RowEditEnded" RaiseOnHandledEvents="True" PassEventArgsToCommand="True" />
                <telerik:EventBinding Command="{Binding CommandProvider.DoAddNew}" EventName="AddingNewDataItem" RaiseOnHandledEvents="True" PassEventArgsToCommand="True" />
                <telerik:EventBinding Command="{Binding CommandProvider.DoValidatingCell}" EventName="CellValidating" RaiseOnHandledEvents="True" PassEventArgsToCommand="True" />
                <telerik:EventBinding Command="{Binding CommandProvider.DoValidatingRow}" EventName="RowValidating" RaiseOnHandledEvents="True" PassEventArgsToCommand="True" />
                <telerik:EventBinding Command="{Binding CommandProvider.DoSelectionChanging}" EventName="SelectionChanging" RaiseOnHandledEvents="True" PassEventArgsToCommand="True" />
            </telerik:EventToCommandBehavior.EventBindings>

.....

</telerik:RadGridView>
 
        <telerik:RadDataPager PageSize="20"
                          Grid.Row="2" FontSize="12" Margin="0,-1,0,0" 
                          Source="{Binding Items, ElementName=LookupListGridCtrl}"
                          IsTotalItemCountFixed="True"
                          DisplayMode="FirstLastPreviousNextNumeric, Text" />

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 27 Jun 2018, 10:58 AM
Hello Thomas,

I tested the reported scenario but I wasn't able to reproduce the issue. Can you check the attached project and let me know if I am missing something? 

Regards,
Martin Ivanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
GridView
Asked by
Thomas
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or