Sorting

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
 
N

Nikolay Petrov

If I make new dataview out of table.default dataview to make some filtering,
how to make the filtered data apear on the DataGrid?
 
N

Nikolay Petrov

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?
 
C

Cor Ligthert

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
 
L

Larry Serflaten

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
 
N

Nikolay Petrov

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top