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

Dataitem became object of Type dynamicClass1 when using Aggregate

2 Answers 110 Views
Grid
This is a migrated thread and some comments may be shown as answers.
CSurieux
Top achievements
Rank 2
CSurieux asked on 19 Oct 2009, 04:41 PM
Hello,

Adding Aggregate to some grid columns I discovered that in ItemDataBound the item.dataitem has been changed from DataRowView to this class dynamicClass1.

How could I use values from the associated Datarow now ?

Thanks
CS

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 20 Oct 2009, 07:01 AM
Hi,

One suggestion would be setting the DataKeyNames as the field and accessing the value using GetDataKeyValue() method of item.
      item.GetDataKeyValue("CustomerID");

Also checkout the following forum that discussed similar scenario:
How do you access the underlying object in the gridview
Aggregating a Template Column

-Shinu.
0
CSurieux
Top achievements
Rank 2
answered on 20 Oct 2009, 08:46 AM
Thanks Shinu,

But I am not satisfied with this, we can't enter in datakeys all necessary fields from large records.
I have found threads related to this problem which seems related to .net 3.5 and usage of LinQ.
It is a side effect of net 3.5 evolution which as not been correctly assumed: if linQ is used somewhere with Dynamics classes it should be done without loose of functionalities.
Telerik or MS should have provided a way, as easy as previously to acces our dataitem, today name of this property became totally inadapted: there is not data item behind it.

Regards

CS
Tags
Grid
Asked by
CSurieux
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
CSurieux
Top achievements
Rank 2
Share this question
or