Dataitem became object of Type dynamicClass1 when using Aggregate

3 posts, 0 answers
  1. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 19 Oct 2009 Link to this post

    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. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 20 Oct 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 20 Oct 2009 Link to this post

    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
Back to Top