User389883181 posted
I have looked all over the web (well most of it :-) and can't find the answer so....
I have a gridview with data from an access database THIS NOT AN SQL DATABASE.
I want to group the gridview by one of the fields.
Does anyone have a link to any site with instructions on how to do this for with an access database NOT SQL Server.
Thanks
It would be something like this (to sort on Shop_type)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
<style type="text/css">
</style>
</head>
<body>
<form id="form1" runat="server">
<asp:GridView runat="server" id="GridView1" AutoGenerateColumns="False" DataSourceID="AccessDataSource1">
<Columns>
<asp:boundfield DataField="Shop_type" HeaderText="Shop Type" SortExpression="Shop_type">
</asp:boundfield>
<asp:boundfield DataField="Shop_name" HeaderText="Shop name" InsertVisible="False" SortExpression="Shop_name">
</asp:boundfield>
</Columns>
</asp:GridView>
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="Shops.mdb" SelectCommand="SELECT [Shop_Type], [Shop_name] FROM [tableshops] ORDER BY [Shop_name]">
</asp:AccessDataSource>
</form>
</body>
</html>