Hi
I would like to know how to sort a datagrid when a user clicks on a hyperlink at the top of a datagrid column.
I have seen in the documentation on p143 that I can sort a datagrid in this way by getting the entire recordset in question and calling sort on the entity collection.
I have already done something like this as follows where viewState sortExpression stores e.sortExpression from the sortCommand event
customers.GetMulti(Nothing)
customers.SupportsSorting = True
customers.Sort(customers(0).Fields(ViewState("SortExpression")).FieldIndex, ComponentModel.ListSortDirection.Descending)
dgCustomers.DataSource = customers
dgCustomers.DataBind()
But what if i want to sort the data on the database and not on the server?
How can i convert a column name as supplied by e.sortExpression into an entity field (IENtityField) like CustomerFieldIndex.customerName so that I can make a sort clause and pass it to getMulti?
Thanks very much
andrea