Binding Linq WhereSelectArrayIterator

2 posts, 0 answers
  1. Torsten
    Torsten avatar
    13 posts
    Member since:
    Jul 2012

    Posted 09 Feb 2011 Link to this post

    My linq expression:

    Root root = Root.GetInstance();
               var betriebe =
                   from w in root.Query(Betrieb.Entity).ToArray()
                   select new
                       Betriebegruppe = "0",
                       Betrieb = w.Get(Betrieb.Werk),
                       Name = w.Get(Betrieb.Name),
                       Strasse = w.Get(Betrieb.Strasse),
                       PLZ = w.Get(Betrieb.Postleitzahl),
                       Ort = w.Get(Betrieb.Ort),
                       EKORG = w.Get(Betrieb.Einkaufsorganisation)

    returns an iterator like this:


    If I bind this as datasource to a radgrid everything works fine. But when I bind it to an radtreelist, the columns were generated but the content is empty.

    Do I have to do more than: 
    treelist.DataSource = betriebe;
    Here is my treelist declaration:
    <telerik:RadTreeList runat="server" ID="rtl" AllowSorting="True" AllowMultiItemSelection="True"
        CausesValidation="false" ParentDataKeyNames="Betriebegruppe" DataKeyNames="Betrieb"
        AllowPaging="True" PageSize="20" Width="100%">
        <telerik:TreeListCheckBoxColumn ></telerik:TreeListCheckBoxColumn>
            <Selecting AllowItemSelection="true" UseSelectColumnOnly="true" />

  2. Nikolay Rusev
    Nikolay Rusev avatar
    2275 posts

    Posted 14 Feb 2011 Link to this post

    Hello Torsten,

    It seems that such binding is working on my side. For your convenience I am attaching sample page demonstrating binding to System.Linq.Enumerable.WhereSelectArrayIterator.

    All the best,
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. DevCraft R3 2016 release webinar banner
Back to Top