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

DataForm doesn't synchronize with GridView : - (

4 Answers 76 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
underwater
Top achievements
Rank 1
underwater asked on 05 Apr 2011, 12:25 PM
I have the following linked Grid and Form

<telerik:RadGridView  Name="radGridView1"
                        
                        ItemsSource="{Binding }"
                        AutoGenerateColumns="True"
                        IsFilteringAllowed="True"
                        IsBusy="False"
                        DataLoadMode="Synchronous"
                        CanUserReorderColumns="True"
                        CanUserSortColumns="True"   />
 
 
   <telerik:RadDataForm
       Name="radDataForm1"
       ItemsSource="{Binding  }"                        
       AutoGenerateFields="True"
                    />



The datacontext for this page is created in the loaded event of the page like this

  
public MainPage()
{
 
    InitializeComponent();
    this.Loaded +=new RoutedEventHandler(MainPage_Loaded);
 
     
}
  
 
void  MainPage_Loaded(object sender, RoutedEventArgs e)
{
  
        ObservableCollection<Book> myBooks = new ObservableCollection<Book>
            {
                new Book{Title="The Man who sold the World",Author="James Martin"},
                new Book{Title="Thow to Make Friends and Influence People",Author="Peter Ducker"},
                new Book{Title="Programming LINQ and .Net 4 Framework",Author="Chris Anderson"}
                         
            };
 
        this.DataContext = myBooks;
}


       

Although the list of books is shown in both the grid and the form, it isn't synchronized and clicking on various records in the grid doesn't cause the form to show the selected item.

Any help would be appreciated.

4 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 05 Apr 2011, 12:27 PM
Hello,

 Have you checked this demo?

Greetings,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
underwater
Top achievements
Rank 1
answered on 05 Apr 2011, 12:32 PM
Hi Vlad,
Thanks for quick response,
Yes, I think my code is identical except that my book list is created a bit differently.
0
Vlad
Telerik team
answered on 05 Apr 2011, 12:34 PM
Hi,

 You have bound the components to a plain ObservableCollection<> - you will need ICollectionView if you want to synchronize currency. 

Greetings,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
underwater
Top achievements
Rank 1
answered on 05 Apr 2011, 12:44 PM
Vlad,
Is there another collection type SL4 that I can use that will implement ICollectionView?
I guess what I am asking what is the simplest way to do this?
Fares
Tags
DataForm
Asked by
underwater
Top achievements
Rank 1
Answers by
Vlad
Telerik team
underwater
Top achievements
Rank 1
Share this question
or