Gridview sorting
-
i am using grid view control in my project i have set autogeneratecolumns false and added columns like this
<Columns> <asp:TemplateField HeaderText="User Name" SortExpression="UserName"> <ItemTemplate> <%#Eval("UserName")%> </ItemTemplate> <ItemStyle HorizontalAlign = "Left" /> </asp:TemplateField> <asp:TemplateField HeaderText="Voice Id"> <ItemTemplate> <a href="javascript:DispalyError('<%#Eval("vid")%>','<%#Eval("UserType") %>')" title="<%#Eval("VoiceId")%>"> <%# Eval("VoiceId") %> </a> </ItemTemplate> <ItemStyle HorizontalAlign="Left" /> </asp:TemplateField>
(more columns) now i want to have sorting property for all columns in the grid can any body please tell me how to do this regards sunilwise -
i am using grid view control in my project i have set autogeneratecolumns false and added columns like this
<Columns> <asp:TemplateField HeaderText="User Name" SortExpression="UserName"> <ItemTemplate> <%#Eval("UserName")%> </ItemTemplate> <ItemStyle HorizontalAlign = "Left" /> </asp:TemplateField> <asp:TemplateField HeaderText="Voice Id"> <ItemTemplate> <a href="javascript:DispalyError('<%#Eval("vid")%>','<%#Eval("UserType") %>')" title="<%#Eval("VoiceId")%>"> <%# Eval("VoiceId") %> </a> </ItemTemplate> <ItemStyle HorizontalAlign="Left" /> </asp:TemplateField>
(more columns) now i want to have sorting property for all columns in the grid can any body please tell me how to do this regards sunilwiseIf you turn on the sorting functionality of the grid view, it will render the headers as links, but you will still need to handle the event that is fired, and write the code to sort your data.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
i am using grid view control in my project i have set autogeneratecolumns false and added columns like this
<Columns> <asp:TemplateField HeaderText="User Name" SortExpression="UserName"> <ItemTemplate> <%#Eval("UserName")%> </ItemTemplate> <ItemStyle HorizontalAlign = "Left" /> </asp:TemplateField> <asp:TemplateField HeaderText="Voice Id"> <ItemTemplate> <a href="javascript:DispalyError('<%#Eval("vid")%>','<%#Eval("UserType") %>')" title="<%#Eval("VoiceId")%>"> <%# Eval("VoiceId") %> </a> </ItemTemplate> <ItemStyle HorizontalAlign="Left" /> </asp:TemplateField>
(more columns) now i want to have sorting property for all columns in the grid can any body please tell me how to do this regards sunilwisesir can you please tell me in detail how to handle the event