Sorting

  • Thread starter Thread starter Nikolay Petrov
  • Start date Start date
N

Nikolay Petrov

I have a DataGrid on my from, which is binded to DataSet.
I would like to sort data in DataGrid from code, or filter it.
I get my DataSet from WebService.

A can't find and Sort method for DataGrid ot for Tables in DataSet.

What can I do?

TIA
 
If I make new dataview out of table.default dataview to make some filtering,
how to make the filtered data apear on the DataGrid?
 
Cor,
Let's say in my web service I create DataSet, add table, fill it with data
and then I use .defaultview.sort = "column_name", then return DataSet to
client and there bind it to a datagrid, should it be sorted, or I should
sort it at client?

I guess second, because I doubt that the sorting is returned in the XML
returned from WebService, right?
 
Nikolay,

I never tested what you ask, because I would normally do that setting of the
defaultview on the client (UI) side, however I think that when you use the
default view it is has not to be impossible.

However I am not sure of that before I test this kind of things.

Maybe can you try it yourself?

Cor
 
Nikolay Petrov said:
Let's say in my web service I create DataSet, add table, fill it with data
and then I use .defaultview.sort = "column_name", then return DataSet to
client and there bind it to a datagrid, should it be sorted, or I should
sort it at client?

You do want to use the DataView to sort your data, but it will not change
the order in the DataSet. Instead you'd bind your DateGrid to the DataView
object (via DataSource property) and not the DataSet.

Have a look in Help for more info, and examples....

LFS
 
Thanks Larry!


Larry Serflaten said:
You do want to use the DataView to sort your data, but it will not change
the order in the DataSet. Instead you'd bind your DateGrid to the
DataView
object (via DataSource property) and not the DataSet.

Have a look in Help for more info, and examples....

LFS
 
Back
Top