Resolved VS2008 Grouping in a GridView

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,530
Location
Lansing, MI; USA
Programming Experience
10+
I currently have 2 queries in a database that are the DataSource (determined by user selecting one from a DropDown) which is working fine, but now the client is asking for a view (a query) that displays both sets of data together. I have the query made and it's working, but with the GridView currently everything is mashed together with no indication which set of data any of it is. What I would like to do is if the "all" item is selected in the dropdown have the GridView put a line at the top that states the first set of data then a line in the middle when the records are showing the 2nd set of data. Anyone know of an easy way to do this?

The columns are pre-defined using the ItemTemplate:
VB.NET:
                        <Columns>
                            <asp:TemplateField HeaderText="College" HeaderStyle-CssClass="data head">
                                <ItemTemplate>
                                    <%#Eval("CLGCODE")%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Age" HeaderStyle-CssClass="data head">
                                <ItemTemplate>
                                    <%#Eval("FullAge")%>
                                </ItemTemplate>
                                <FooterTemplate>
                                    <div>Totals</div>
                                </FooterTemplate>
                                <FooterStyle Font-Bold="true" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Non-Resident Alien Men" HeaderStyle-CssClass="data head">
                                <ItemStyle CssClass="RightAlign" />
                                <ItemTemplate>
                                    <%#Eval("AlienM")%>
                                </ItemTemplate>
                                <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                            </asp:TemplateField>
and so on.....
The DataSource is simple a DataTable set in code once the table is filled via a DataAdapter.
 
Back
Top