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:

    System.Linq.Enumerable.WhereSelectArrayIterator<P0300_DAL.Data.AnyObject,<>f__AnonymousType0<string,string,string,string,string,string,string>>

    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%">
        <Columns>
        <telerik:TreeListCheckBoxColumn ></telerik:TreeListCheckBoxColumn>
        </Columns>
        <ClientSettings>
            <Selecting AllowItemSelection="true" UseSelectColumnOnly="true" />
        </ClientSettings>
    </telerik:RadTreeList>


  2. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2284 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,
    Nikolay
    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. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top