1
我下面的代碼片段不允許在DataGrid中排序:爲什麼DataGrid排序不能與AutoGenerateColumns一起使用=「False」?
<asp:DataGrid ID="tubewell" runat="server" AllowSorting="True"
AutoGenerateColumns="False" OnSortCommand="sortColumn"
>
<Columns>
<asp:BoundColumn DataField="tubeWell_ID" DataFormatString="#{0:c}"
HeaderText="Tubewell </br> ID"></asp:BoundColumn>
<asp:BoundColumn DataField="status" HeaderText="Status" Visible="False">
</asp:BoundColumn>
</Columns></asp:DataGrid>
以下允許:
<asp:DataGrid ID="tubewell" runat="server" AllowSorting="True"
AutoGenerateColumns="True" OnSortCommand="sortColumn"
>
</asp:DataGrid>