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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

C# 2.0 DataGridView Sort Problem

Status
Not open for further replies.

cjtaylor

Programmer
Aug 12, 2001
69
US
I am having a problem sorting my DataGridView in descending order. Everything works fine when sorting by ascending order using:

OrderTable.Rows.Add(objDR);
OrderTable.AcceptChanges();
dataGridView.DataSource = OrderTable;
dataGridView.Sort(dataGridView.Columns["ID"],ListSortDirection.Ascending)

but when I change the ListSortDirection to ListSortDirection.Descending, the dataGridView seems to add an uncommitted empty row at the end of the gridview. The underlying datasource has the correct # of records, but not the gridview.

Any ideas?

Thanks
Chris Taylor
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top