This is a migrated thread and some comments may be shown as answers.

Grouping Titles

2 Answers 91 Views
ListView
This is a migrated thread and some comments may be shown as answers.
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve asked on 06 May 2010, 01:54 AM
How can I get Group Titles (based on the dataset) into my listview?

The H2 in my Group Template doesn't appear to work, but the data IS in the dataset

 <telerik:RadListView ID="imageListView" runat="server" onneeddatasource="imageListView_NeedDataSource" 
                                 ItemPlaceholderID="mainImagesContainer" GroupPlaceholderID="GroupContainer"
 
                <LayoutTemplate> 
                    <asp:PlaceHolder ID="GroupContainer" runat="server" /> 
                </LayoutTemplate> 
 
                <GroupTemplate> 
                    <h2><%# Eval("LibraryName")%></h2
                    <asp:PlaceHolder ID="mainImagesContainer" runat="server" /> 
                </GroupTemplate> 
 
                <ItemTemplate> 
                    <div class="imageContainer"
                        <asp:Image ID="image" runat="server" CssClass="imageItem" ImageUrl='<%# Eval("ImageURL") %>' EnableViewState="false" /><br /> 
                        <asp:CheckBox ID="check" runat="server" CssClass="checkItem" EnableViewState="false" /> 
                        <asp:Label ID="name" runat="server" CssClass="imageName" EnableViewState="false" Text='<%# Eval("ImageTitle") %>' /> 
                    </div> 
                </ItemTemplate> 
            </telerik:RadListView> 

Is this just not supported?

2 Answers, 1 is accepted

Sort by
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 06 May 2010, 01:57 AM
....oh wait

Am I reading this right?  The grouping isn't based on a field?

...is it COUNT based?
0
Sean Sparkman
Top achievements
Rank 2
answered on 06 May 2010, 05:57 PM
What I have done is created a field in the class of the page (or control) for the title.  I setup the ItemDataBound event to look at the field in the class and the field in the datasource.  If they are different make the title label, literal or whatever control visible.
Tags
ListView
Asked by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Answers by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Sean Sparkman
Top achievements
Rank 2
Share this question
or