I am using Telerik's Silverlight RadGridView in my application. Recently i downloaded the RadControls for Silverlight Q1 2010 SP2 and replaced the old assemblies with new one. But after building my project i got the following errors;
- 'Telerik.Windows.Controls.RadGridView' does not contain a definition for 'ItemsControl' and no extension method 'ItemsControl' accepting a first argument of type 'Telerik.Windows.Controls.RadGridView' could be found (are you missing a using directive or an assembly reference?)
- 'Telerik.Windows.Controls.GridView.GridViewRow' does not contain a definition for 'Items' and no extension method 'Items' accepting a first argument of type 'Telerik.Windows.Controls.GridView.GridViewRow' could be found (are you missing a using directive or an assembly reference?)
Here is the code snippet, where i got these errors. I think ItemsControl and Items property is removed from latest version of Silverlight controls.
Is there any other properties in new version having same functionality of ItemsControl and Items?
10 Answers, 1 is accepted
In the context of improving performance and optimizing memory consumption, we have made a major refactoring to the scrolling and virtualization logic of RadGridView.
This is the reason to lose the properties/methods you have mentioned.
Looking at your code I assume you are trying to set an ItemsSource for a ComboBox in a GridView cell .
I believe we can find a good replacement for your code with the current version of RadGridView.
Can you please share some more details on the entire scenario. What is the final goal you are trying to achieve and I am sure we can think of some good solution.
For example - we may expose the ItemsSource for the combo boxes as a static resource and bind the combo to it directly in XAML .
Once I have your requirements I will gladly gather a small sample for you .
the Telerik team
Thanks for your reply.
Yes, you are right. In my application i am trying to set an ItemsSource for a ComboBox in a GridView cell which is data template. I am retriving data from SharePoint list and binding to the Combo box. I am following this approach because the number of rows in grid view is not fixed. The number of rows depends upon the value selected by user. Below is the approach I am using to create specified number of rows.
Here the value of count may be from 2 to 8, as per selected by user. After then I am creating the cells for each row having the combo box in cell.
Here is the XAML of my RadGridview;
Waiting for your response.
Instead of using the itemcontainer generator to obtain a row,
you can subscribe to the RowLoaded event and set the ItemsSource there . Each time a row is loaded , within the event handler you may set its items source .
This is the recommended way.
the Telerik team
I have same problem. i did not find the "ItemsControl" property for RadGridview. So how can i get the perticular GridviewCell for the Radgridview in code behind after the control loading?
My requirement is setting the tooltip for a perticular cell according to business rule.
Thanks & Best Regards,
The better approach in your case is to use ToolTipTemplateSelectors, you may check this demo.
the Telerik team
Thanks for your quick response.
But my requirement is like below code in the current version of the telerik which is not supporting "ItemsControl" property. I dont need the tooltip binding per each cell column wise , i want the tooltip for a pericular cell through the row and column index.
public void SetCellTooltip(int rowindex, int columnindex,string tooltip)
var row = (GridViewRow)this.gridview.ItemsControl.ItemsGenerator.GenerateItemAtIndex(rowindex);
GridViewCell Cell = (GridViewCell)row.Items[columnindex];
I tried out RadGridView scroll sample in two different versions (2009.2.701.1020 and 2012.2.912.1050). What my requirement is to scroll two grid synchronously in horizontal direction, the sample work fine in 2009.2.701.1020 but some event and methods missing in 2012.2.912.1050, which make it difficult to achieve it. I enclosed sample project which i obtained from telerik. Help me to achieve the same functionality in 2012.2.912.1050.
Functionality not available in 2012:
1. this.RadGridView1.ItemsControl.Loaded // ItemsControl not available in 2012
2. void verticalScrollBar1_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
I Enclosed sample image with it. Thanks
I would suggest you to check this github demo for an example on how to scroll two GridViews simultaneously.
I hope this helps.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>