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

Duplicate row when using IEnumerable as data source

3 Answers 61 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ivan
Top achievements
Rank 1
Ivan asked on 27 Feb 2009, 10:11 AM
Hi,
I have the following problem: when I set an IEnumerable collection as a data source to a RadGrid control that has EnableLinqExpressions property set to false then the first element of the collection is displayed twice in the grid. The IEnumerable collection consists of objects of different types but with common base type. My version of the control is 2008.3.1314.35.
I made some search in the Telerik.Web.UI assembly and I think the problem is in the AdvancedEnumerator class that returns the first element twice. Is there really a problem with that class or the problem is somewhere in my code?
Thanks in advance

3 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 04 Mar 2009, 12:26 PM
Hi Ivan,

I'm afraid that I'm unable to reproduce the behavior in question locally. I have attached  a very simple test page, please take a look maybe I'm missing something obvious. 

Sincerely yours,
Rosen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Ivan
Top achievements
Rank 1
answered on 04 Mar 2009, 02:52 PM
Hi,
Thanks for replying. I checked the example you sent me and with a little change I was able to reproduce it. Please make the following changes to the code.
In RadGrid1_NeedDataSource instead of
IEnumerable<Animal> list = new List<Animal>() {new Dog(), new Cat(), new Dog()}; 
try this
Dictionary<string, Animal> list = new Dictionary<string, Animal>(); 
list.Add("Sharo", new Dog()); 
list.Add("Matza", new Cat()); 
list.Add("Roshko", new Dog()); 
The data source should not be IList (that's my mistake not specifying it).

Add this property to the RadGrid:
EnableLinqExpressions="false" 
The name "Sharo" appears in the first and the second row.
Best regards,
Ivan
0
Accepted
Rosen
Telerik team
answered on 06 Mar 2009, 02:32 PM
Hi Ivan,

Indeed I was able to observe the behavior in question. However I'm happy to inform you that our developers has managed to address it, thus the fix will be available with 2009 Q1 version of RadControls for ASP.NET AJAX. Meanwhile as a small token of gratitude I have updated your telerik points.

Please excuse us for the inconvenience.

Regards,
Rosen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Ivan
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Ivan
Top achievements
Rank 1
Share this question
or