Get a var from Items...

3 posts, 1 answers
  1. Marc Roussel
    Marc Roussel avatar
    429 posts
    Member since:
    Dec 2009

    Posted 02 Feb 2011 Link to this post

    I'm trying to do a Linq query on the items of the GridView but I don't know how to go about that.  I tried several ways and I'm unable to figure out how to convert or get the list out of GridViewItems

    This is my last attenpt which doesn't work at all..

    var SumQuantity = (FROM ocs IN rgvShipTos.Items.OfType<ObservableCollection<Foo_OC_ShipTo>>().ToList())
                                        SELECT ocs.Qty).Sum();

    Thank you fro any help.
  2. Answer
    Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 02 Feb 2011 Link to this post

    Hi,

    The type used in OfType<>() should be your data item type. 

    Greetings,
    Vlad
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  3. DevCraft banner
  4. Marc Roussel
    Marc Roussel avatar
    429 posts
    Member since:
    Dec 2009

    Posted 02 Feb 2011 Link to this post

    Thank you
Back to Top