datagrid problem - sorting
Posted on 2004-09-02
I have a problem with my DataGrid.
Afther I select sorting by anything else then id (which coincides with my default view), i get the new DataGrid layout, but then if i try to do anything with my DataGrid entries, i get wrong IDs.
The IDs I get alre from the old (default) DataGrid.
What am I missing?
private void SortCommand(object source,System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
DataGrid1.DataSource = GetDSbySortExpr(int.Parse(e.SortExpression));
where GetDSbySortExpr connect to the database and returns a query according to my SortExpression:
case 0 : select...order by Id..
case 1 : select...order by name...