我有一个网格视图,我想对 Gridview 进行排序。我尝试了谷歌的严格方法,但它们在我身边不起作用。
我的gridvie代码就像
<asp:GridView ID="gridviewShopData" runat="server" DataSourceID="SqlDataSource1" Width="100%"
AllowSorting="True" AutoGenerateColumns="False" GridLines="None"
CssClass="contactList grid" PageSize="30" ShowHeaderWhenEmpty="true">
<Columns>
<asp:TemplateField HeaderText="Fornavn">
<ItemTemplate>
<%# Eval("Fornavn") %>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Efternavn">
<ItemTemplate>
<%# Eval("Efternavn") %>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Medarbejder nummer">
<ItemTemplate>
<%# Eval("Medarbejder nummer") %>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Varenummer">
<ItemTemplate>
<%# Eval("Varenummer") %>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<AlternatingRowStyle CssClass="altrow" />
<PagerSettings FirstPageText="First" LastPageText="Last" PageButtonCount="50" />
<EmptyDataTemplate>
There is no data available to display!
</EmptyDataTemplate>
<PagerStyle CssClass="pager" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" SelectCommand="SELECT firstName as 'Fornavn',lastName as 'Efternavn',employeeNumber as 'Medarbejder nummer',productID as 'Varenummer' FROM sydShopOrder where shopID=@pageid">
<SelectParameters><asp:QueryStringParameter Name="pageid" QueryStringField="id"/></SelectParameters>
</asp:SqlDataSource>
如何使它成为可能任何人的帮助。