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

Telerik.Windows.Data

1 Answer 109 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 30 May 2010, 06:07 PM
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 

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Milan
Telerik team
answered on 31 May 2010, 07:31 AM
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.
Tags
General Discussions
Asked by
Chris
Top achievements
Rank 1
Answers by
Milan
Telerik team
Share this question
or