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

RowIndicator do not synchronized with CurrentItem

4 Answers 164 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Harald
Top achievements
Rank 2
Harald asked on 04 Jul 2016, 11:27 AM

Hi,

i am using a DataGrid with IsSynchronizedWithCurrentItem="True".  It does not work.

01.<telerik:RadGridView x:Name="MyDataGrid"
02.        Grid.Row="1"
03.        SelectionMode="Single"
04.        IsReadOnly="True"
05.        AutoGenerateColumns="False"
06.        IsSynchronizedWithCurrentItem="True"
07.        CanUserDeleteRows="False"
08.        CanUserFreezeColumns="False"
09.        CanUserInsertRows="False"
10.        CanUserReorderColumns="False"
11.        CanUserResizeColumns="False"
12.        CanUserSortColumns="False"
13.        CanUserSortGroups="False"
14.        IsFilteringAllowed="False"
15.        ShowGroupPanel="False"
16.        ShowColumnHeaders="False"
17.        ItemsSource="{Binding ItemsSource, ElementName=MyDataForm}"
18.        SelectedItem="{Binding CurrentItem, ElementName=MyDataForm}">
19.    <telerik:RadGridView.Columns>
20.        <telerik:GridViewDataColumn DataMemberBinding="{Binding Id}" Header="Id" Width="20" IsVisible="False"/>
21.        <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Katalogeintrag" Width="*"/>
22.        <telerik:GridViewDataColumn DataMemberBinding="{Binding Catalog.Id}"  Header="Katalog" Width="20" IsVisible="False"/>
23.        <telerik:GridViewDataColumn DataMemberBinding="{Binding Locked}" Header="Gesperrt" Width="10" IsVisible="False"/>
24.        <telerik:GridViewDataColumn DataMemberBinding="{Binding System}" Header="System" Width="10" IsVisible="False"/>
25.    </telerik:RadGridView.Columns>
26.</telerik:RadGridView>

4 Answers, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 05 Jul 2016, 01:11 PM
Hello Harald,

I'm attaching a sample project where RadGridView's IsSynchronizedWithCurrentItem property is working as expected. Could you please have a look at it and let me know if I'm missing something important? Providing more details about the exact setup at your end would definitely be of help in finding a solution.

Thank you in advance for your cooperation on the matter.

Regards,
Dilyan Traykov
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Harald
Top achievements
Rank 2
answered on 06 Jul 2016, 07:06 PM

Thank you for the example. In my Application it does not work. I am using a RadEntityFrameworkDataSource as ItemSource for the DataForm. 

1.<telerik:RadEntityFrameworkDataSource Name="CatalogEntriesDataSource" QueryName="CatalogEntries">
2.        </telerik:RadEntityFrameworkDataSource>

Maybe that's wrong?
0
Accepted
Dilyan Traykov
Telerik team
answered on 07 Jul 2016, 12:39 PM
Hello Harald,

Could you please set the ItemsSource for your RadDataForm like so:

ItemsSource="{Binding DataView, ElementName=CatalogEntriesDataSource}"

And for RadGridView:

ItemsSource="{Binding DataView, ElementName=CatalogEntriesDataSource}"
SelectedItem="{Binding DataView.CurrentItem, Mode=OneWay, ElementName=CatalogEntriesDataSource}"

This way the selected item should be synchronized across the two controls. Please give this a try and let me know how it goes.

Regards,
Dilyan Traykov
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Harald
Top achievements
Rank 2
answered on 07 Jul 2016, 08:14 PM
Thank you.
Tags
GridView
Asked by
Harald
Top achievements
Rank 2
Answers by
Dilyan Traykov
Telerik team
Harald
Top achievements
Rank 2
Share this question
or