ListView - DataGrouping with multiple DataKeyNames

2 posts, 0 answers
  1. Loyal User
    Loyal User avatar
    37 posts
    Member since:
    Apr 2012

    Posted 05 Mar 2014 Link to this post

    i use this demo  for my issue ,
    it works fine ,
    but i want to use 2 datakeyNames :

       <asp:Panel runat="server" ID="Panel3" CssClass="dataGroup" GroupingText='<%# (Container as RadListViewDataGroupItem).DataGroupKey %>'>
          <asp:Image ID="CarImage" runat="server" AlternateText="Car Image" CssClass="car_brand_img" ImageUrl='<%# "Img/" + (Container as RadListViewDataGroupItem).DataGroupKey + ".png" %>' />
             <asp:PlaceHolder runat="server" ID="DataGroupPlaceHolder3">/asp:PlaceHolder>
    <asp:Label runat="server" ID="Label39" CssClass="groupFooter clearfix" Text='<%# "Lower booking price: " + (Container as RadListViewDataGroupItem).AggregatesValues["Price"].ToString() %>'>

    my changes :

    my question is :  how to use (Container as RadListViewDataGroupItem).DataGroupKey to specify each DataKeyNames ??
  2. Eyup
    Eyup avatar
    3645 posts

    Posted 10 Mar 2014 Link to this post


    I'm afraid it is not possible to pass multiple data evaluations in single DataGroupItem. The DataKeyNames property determines the fields which you can access via  RadListViewDataItem:
    string value = (container as RadListViewDataItem).GetDataKeyValue("Name");
    With RadListViewDataGroupItem you can only get the DataGroupKey, which is the corresponding value of the field used for grouping:
    <telerik:ListViewDataGroup ... GroupField="BrandName" >

    I hope the clarification was helpful.


    DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

Back to Top