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

Question about Groups in RadGrid

4 Answers 122 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Guillermo Aquino
Top achievements
Rank 1
Guillermo Aquino asked on 05 Jul 2010, 08:52 AM
I'm using a RadGridView for Silverlight - version Q2 2010
Firstly, my Grid hasn't groups, 
My problem is that when i do the first grouping then items.groups property has a exception

+  base {System.InvalidCastException: Impossible d'effectuer un cast de l'objet de type 'Telerik.Windows.Examples.Customers' en type 'Telerik.Windows.Data.AggregateFunctionsGroup'.
  
On the other hand if i delete and re-create the same group, this error is not showing.


Thanks
Guillermo

4 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 05 Jul 2010, 09:32 AM
Hi Guillermo Aquino,

I will try to reproduce  the error here , can you please paste me your code ( XAML and codebehind ) , so that I can try build a small test app and see what is wrong.  What I need is the XAML definition of RadGridView as well as the code-behind so I can see how do you bind RadGridView.

Best wishes,
Pavel Pavlov
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
0
Guillermo Aquino
Top achievements
Rank 1
answered on 05 Jul 2010, 09:44 AM
Hi
for my test, I'm using the RowNumber Gridview Example for "RadControls for Silverlight Q2 2010".

XAML
<Examples:GridViewExample x:Class="Telerik.Windows.Examples.GridView.RowNumber.Example" 
 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
 
xmlns:Examples="clr-namespace:Telerik.Windows.Examples" 
 
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" 
 
xmlns:custom="clr-namespace:Telerik.Windows.Examples.GridView.RowNumber">  
 
<Grid> 
 
<Image Source="/GridView;component/Images/bg02.jpg" /> 
 
<telerik:RadGridView x:Name="RadGridView1" ItemsSource="{Binding Customers}" AutoGeneratingColumn="RadGridView1_AutoGeneratingColumn">  
 
<telerik:RadGridView.Columns> 
 
<custom:MyColumn Header="#" Width="50" /> 
 
</telerik:RadGridView.Columns> 
 
</telerik:RadGridView> 
 
</Grid> 
 
</Examples:GridViewExample> 
 

Code-Behind

using Telerik.Windows.Data;  
 
using System.ComponentModel;  
 
using Telerik.Windows.Controls;  
 
namespace Telerik.Windows.Examples.GridView.RowNumber  
 
{  
 
/// <summary>  
 
/// Interaction logic for Example.xaml  
 
/// </summary>  
 
public partial class Example  
 
{  
 
public Example()  
 
{  
 
InitializeComponent();  
 
this.RadGridView1.Grouped += new System.EventHandler<Controls.GridViewGroupedEventArgs>(RadGridView1_Grouped);  
 
}  
 
private void RadGridView1_Grouped(object sender, GridViewGroupedEventArgs e)  
 
{  
 
DataItemCollection dic = RadGridView1.Items;  
 
 
}  
 
private void RadGridView1_AutoGeneratingColumn(object sender, Telerik.Windows.Controls.GridViewAutoGeneratingColumnEventArgs e)  
 
{  
 
if (e.Column.UniqueName == "Order" || e.Column.UniqueName == "Product")   
 
{  
 
e.Cancel = true;  
 
}  
 
}  
 
}  
 
}  
 

Thanks
  Guillermo
0
Guillermo Aquino
Top achievements
Rank 1
answered on 08 Jul 2010, 02:34 PM
Any solutions?
0
Vlad
Telerik team
answered on 08 Jul 2010, 04:01 PM
Hello Guillermo,

We were able to identify the problem and this issue will be fixed for our official release (next week). I've added 2000 Telerik points to your account.

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
Tags
GridView
Asked by
Guillermo Aquino
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Guillermo Aquino
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or