DataView sort does not show in DataGrid

  • Thread starter Thread starter Bill Todd
  • Start date Start date
B

Bill Todd

I have a DataTable in a DataSet. A DataGrid is bound to the DataTable.
When I assign a field to the DataTable.DefaultView.Sort property the
order in the DataGrid does not change.

What am I missing?
 
Todd:

The DefaultView will send the sort back to its original state, so if you
haven't reset it, then it's not going to do anything. Just to test, call
..Sort on another field, anyone will do just to verify that it's working. If
you've already called so, then let me know.

Cheers,

bill
 
Hi Bill,

I reviewed the thread, and find that you have posted a similar problem inn
the same newsgroup.
Subject: Why must I rebind DataGrid to see Sort?
Newsgroups: microsoft.public.dotnet.languages.csharp

You may go and have a check, if you still have any concern on this issue,
please post there and I will follow up in that thread.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Bill:

I just read your top post.. You are binding to the DataTable... Create a
DataView and bind to it instead. The View's sort has No effect on the
datatable's positioning, so if the grid is bound to it, it won't do
anything. Bind to the view instead.
 
Back
Top