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

Grouping System.ArgumentOutOfRangeException

5 Answers 123 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Walter
Top achievements
Rank 1
Walter asked on 14 Sep 2011, 09:18 AM
Hi,

I'm using
The RadGridView v. 2011_2_0712 of the Telerik Controls
Ado.Net Entity Framework 4.1
VistaDB 4.2.18.4 or MSSQL Server 2008

I'm trying to bind a simple RadGridView to a model and then to use the built-in functions.
I have two identical test projects and two identical sampleDBs the one is in VistaDB and the other in MSSql. In the first project I use the Entities from the model generated using the VistaDB and in the second project using MSSql. 

The binding is done like this in both projects.
public partial class MainWindow : Window 
    public MainWindow() 
    
        InitializeComponent(); 
   
        Entities context = new Entities(); 
        radGridView1.ItemsSource = context.Organisationseinheiten; 
    
}

The Sql script to generate the tables is like this.
CREATE TABLE [Organisationseinheiten] (
[OEID] Int PRIMARY KEY,
[Name] NChar(128) NOT NULL,
[Beschreibung] NChar(500) NULL
);
  
INSERT INTO Organisationseinheiten (OEID, Name, Beschreibung)
VALUES (1, 'OE1', 'OE1');
INSERT INTO Organisationseinheiten (OEID, Name, Beschreibung)
VALUES (2, 'OE3', 'OE1');
INSERT INTO Organisationseinheiten (OEID, Name, Beschreibung)
VALUES (3, 'OE3', 'OE1');
INSERT INTO Organisationseinheiten (OEID, Name, Beschreibung)
VALUES (4, 'OE4', 'OE1');

Summary:
Project 1
- RadGridView
- Ado.Net 4.1
- Model from VistaDB

Project 2
- RadGridView
- Ado.Net 4.1
- Model from MSSQL

The two DBs are generated with the same script and seem to been exactly the same. The generated models are exactly the same. BUT when I try to group columns in the project 1 then an exception is thrown. In project 2 the whole grouping, sorting and filtering functions are done well.

Anyone knows about issues of the RadGridView with Ado.Net or with VistaDB?

If it's requested can I upload these two test projects.

Thanks in advance
Walter

5 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 14 Sep 2011, 11:29 AM
Hi Walter,

 Can you post the exception stacktrace?

Regards,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Walter
Top achievements
Rank 1
answered on 14 Sep 2011, 11:41 AM
Hi Vlad,

sure can I post it. I can't debug because I don't have the sources, I hope you can help.

This is the stactrace with only one table.
bei Telerik.Windows.Data.QueryableCollectionView.GetItemAt(Int32 index) in c:\TB\101\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.cs:Zeile 1766.
bei Telerik.Windows.Data.DataItemCollection.get_Item(Int32 index) in c:\TB\101\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\DataItemCollection.cs:Zeile 452.
bei Telerik.Windows.Controls.GridView.GridViewGroupRow.OnIsExpandedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) in c:\TB\101\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\Rows\GridViewGroupRow.cs:Zeile 265.
bei System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
bei System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
bei System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
bei System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
bei System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
bei MS.Internal.Data.PropertyPathWorker.SetValue(Object item, Object value)
bei MS.Internal.Data.ClrBindingWorker.UpdateValue(Object value)
bei System.Windows.Data.BindingExpression.UpdateSource(Object value)

And I have seen another thing. If I add a nested grid with this code...
var ma = new Telerik.Windows.Controls.GridViewTableDefinition();
ma.Relation = new Telerik.Windows.Data.PropertyRelation("Mitarbeiter");
radGridView1.TableDefinition.ChildTableDefinitions.Add(ma);
  ...then the grouping in the nested grid goes without problems. But in the grouping of the outer grid has nothing changed and it has the same problem like before.

Regards,
Walter
0
Vlad
Telerik team
answered on 14 Sep 2011, 11:42 AM
Hi Walter,

 Please open support ticket and attach the project.

Greetings,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Walter
Top achievements
Rank 1
answered on 14 Sep 2011, 12:34 PM
The ticket is open, thanks.
0
Vlad
Telerik team
answered on 14 Sep 2011, 01:27 PM
Hi Walter,

 I've just checked your project. Please call ToList() before assigning ItemsSource to avoid this problem. Here is an example:

radGridView1.ItemsSource = context.Organisationseinheiten.ToList();

Kind regards,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Walter
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Walter
Top achievements
Rank 1
Share this question
or