Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting a datagrid 1

Status
Not open for further replies.

ravula2000

IS-IT--Management
Mar 8, 2002
205
US
Iam trying with this code

<asp:DataGrid id=&quot;fdgdHist&quot; Runat=&quot;Server&quot;
AutoGenerateColumns=&quot;False&quot;
AllowSorting = &quot;True&quot; OnSortCommand = &quot;SortCommand_OnClick&quot;>
<columns>
<asp:BoundColumn DataField=&quot;ext_file_name&quot; HeaderText=&quot;File Name&quot;/>
<asp:BoundColumn DataField=&quot;ext_file_Date&quot; HeaderText=&quot;date&quot;/>
</columns>
</asp:DataGrid>


Sub fbtnHist_Click(s As Object, e As EventArgs)
fdgdHist.DataSource= Getting dataset using lsSQLHist
fdgdHist.DataBind()
End Sub

Sub SortCommand_OnClick(s As Object, e As DataGridSortCommandEventArgs)
lsSQLHist = lsSQLHist '& &quot; ORDER BY &quot; & e.SortField
fbtnHist_Click
End Sub

======
Iam getting SortField is not a member of DataGridSortCommandEventArgs..

Why?

Thanks
SRini
 
Try putting your sort expression in your columns:
i.e. <asp:BoundColumn DataField=&quot;ext_file_name&quot; SortExpression=&quot;ext_file_name&quot; HeaderText=&quot;File Name&quot;>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top