Nitol Biswas

Nitol Biswas

  • NA
  • 173
  • 28.4k

How to Disable auto sorting in GridView.

Dec 18 2016 2:31 AM
 This is my GridView I want disable auto sort in this. How can I do this. I set AllowSorting="false" but it is not working
 
<asp:GridView ID="GridView1" ShowFooter="true" runat="server" AutoGenerateColumns="False" EnableModelValidation="True" DataKeyNames="emb_id" Width="896px" OnRowCommand="GridView1_RowCommand" AllowSorting="false" >
 
<asp:TemplateField HeaderText = "?????? <br> <br>Profession" ItemStyle-Width="40">
<ItemTemplate>
<asp:Label ID="lblProfession" Text='<%# Eval("job_title_arabic") %>' runat="server" Width="120"/>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText = "??? <br> <br>Year" ItemStyle-Width="40">
<ItemTemplate>
<asp:Label ID="lblYear" Text='<%# Eval("visa_iss_date","{0:y}") %>' runat="server" Width="120"/>
</ItemTemplate>
</asp:TemplateField>
 
</asp:GridView> 
 
thanks 

Answers (2)