Telerik.Windows.Data

2 posts, 1 answers
  1. Chris
    Chris avatar
    53 posts
    Member since:
    Oct 2012

    Posted 30 May 2010 Link to this post

    Hi,

              The code below runs in Silverlight 2.0 and creates and error when I  used the same code in Silveright 4.0  (using Telerik Q1 2010).

                 Telerik dlls currently  reference:                   version: 2010.1.422.1030
                        Telerik.Windows.Controls
                        Telerik.Windows.Controls.Docking
                        Telerik.Windows.Controls.GridView
                        Telerik.Windows.Controls.Input
                         Telerik.Windows.Controls.Navigation
                        Telerik.Windows.Data
                        Telerik.Windows.Themes.Vista
              

    private

     

     

    void appGrid_SelectionChanged(object sender, SelectionChangeEventArgs e)

     

    {

    _selectedRecordIndex = ((Telerik.Windows.Data.DataRecord)((

     

    RadGridView)sender).SelectedRecord).DataSourceIndex;

     

    }

             Problems:
                  1.) Code:
                         Telerik.Windows.Data.DataRecord
                      Error:
                          DataRecord
                      Error Message:
                            The type namespace 'DataRecord' does not exist in the namespace 'Telerik.windows.Data' (Are you missing an assembly reference?            

                  2.) Code:                   

     

                        ((Telerik.Windows.Data.DataRecord)((

     

    RadGridView)sender).SelectedRecord).DataSourceIndex;
                      
                       Error:
                             SelectedRecord
                       Error Message:
                           'Telerik.Windows.Controls.RadGridView' does not contain a definition for 'SelectedRecord' and no extension method 'SelectedRecord' accepting a first argument of type 'Telerik.Windows.Controls.RadGridView' could be found (are you missing a using directive or an assembly reference?)


                 Let me know what's the updated code to make this code run in new version.

    Thanks,
    Chris 

     

  2. Answer
    Milan
    Admin
    Milan avatar
    1989 posts

    Posted 31 May 2010 Link to this post

    Hello Chris,

    WE have eliminated the DataRecord class several releases ago. You can transform the obsolete code the following way:

    var gridView = sender as RadGridView;
    _selectedItemIndex = gridView.Items.IndexOf(gridView.SelectedItem);


    All the best,
    Milan
    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.
Back to Top