Syncing DataForm and Grid

2 posts, 0 answers
  1. Edward
    Edward avatar
    83 posts
    Member since:
    Feb 2011

    Posted 12 Apr 2011 Link to this post

    One of the Silverlight demo was syncing between data form and grid - changing one will change the other.

    However, I could not get it to work.  Did I make a mistake here?

    private IEnumerable<Entity> _others;
     private OthersContext _context;    
     
     private void Page_Loaded(object sender, RoutedEventArgs e)
     {
         _context = new Web.OthersContext();
         _context.Load(_context.GetOthersQuery(), LoadCallBack, null);
     }
     
     private void LoadCallBack(LoadOperation lo)
     {
         if (lo.HasError)
         {
             MessageBox.Show(lo.Error.Message);
         }
         else
         {
             _others = lo.Entities;
             dataform1.ItemsSource = _others ;
             grid1.ItemsSource = _others ;
         }
     }
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 13 Apr 2011 Link to this post

    Hello,

     You need to use ICollectionView (check the demo title, description, code, etc.) to achieve your goal. 

    Regards,
    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
Back to Top