DataForm doesn't synchronize with GridView : - (

5 posts, 0 answers
  1. underwater
    underwater avatar
    4 posts
    Member since:
    Mar 2011

    Posted 05 Apr 2011 Link to this post

    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.
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 05 Apr 2011 Link to this post

    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
  3. DevCraft banner
  4. underwater
    underwater avatar
    4 posts
    Member since:
    Mar 2011

    Posted 05 Apr 2011 Link to this post

    Hi Vlad,
    Thanks for quick response,
    Yes, I think my code is identical except that my book list is created a bit differently.
  5. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 05 Apr 2011 Link to this post

    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
  6. underwater
    underwater avatar
    4 posts
    Member since:
    Mar 2011

    Posted 05 Apr 2011 Link to this post

    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
Back to Top
DevCraft banner