473,503 Members | 2,150 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sorting

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
Nov 21 '05 #1
6 1242
Nikolay,

To sort datatables you can use the defaultview and from that the sort
property

ds.tables(0).defaultview.sort = "mycolumn"

(you can as well make an extra dataview, what the defaultview is/returns)

http://msdn.microsoft.com/library/de...ssorttopic.asp

I hope this helps?

Cor
Nov 21 '05 #2
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 Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Nikolay,

To sort datatables you can use the defaultview and from that the sort
property

ds.tables(0).defaultview.sort = "mycolumn"

(you can as well make an extra dataview, what the defaultview is/returns)

http://msdn.microsoft.com/library/de...ssorttopic.asp

I hope this helps?

Cor

Nov 21 '05 #3
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?

"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Nikolay,

To sort datatables you can use the defaultview and from that the sort
property

ds.tables(0).defaultview.sort = "mycolumn"

(you can as well make an extra dataview, what the defaultview is/returns)

http://msdn.microsoft.com/library/de...ssorttopic.asp

I hope this helps?

Cor

Nov 21 '05 #4
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
Nov 21 '05 #5

"Nikolay Petrov" <jo**************@mail.bg> wrote
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
Nov 21 '05 #6
Thanks Larry!
"Larry Serflaten" <se*******@usinternet.com> wrote in message
news:Oe**************@TK2MSFTNGP12.phx.gbl...

"Nikolay Petrov" <jo**************@mail.bg> wrote
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

Nov 21 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2518
by: dont bother | last post by:
This is really driving me crazy. I have a dictionary feature_vectors{}. I try to sort its keys using #apply sorting on feature_vectors sorted_feature_vector=feature_vectors.keys()...
0
2706
by: ck388 | last post by:
For some reason when I enable the callback feature of the gridview I still get a page refresh, that is it seems like there is a postback that occurs, not a callback which is just supposed to update...
7
3235
by: Federico G. Babelis | last post by:
Hi All: I have this line of code, but the syntax check in VB.NET 2003 and also in VB.NET 2005 Beta 2 shows as unknown: Dim local4 As Byte Fixed(local4 = AddressOf dest(offset)) ...
19
25424
by: Owen T. Soroke | last post by:
Using VB.NET I have a ListView with several columns. Two columns contain integer values, while the remaining contain string values. I am confused as to how I would provide functionality to...
10
2748
by: Sjaakie | last post by:
Hi, I'm, what it turns out to be, fooling around with 3-tier design. At several websites people get really enthusiastic about using custom dataobjects instead of datasets/-tables. While trying to...
4
3083
by: Ambica Jain | last post by:
Hi, I want custom sorting on some of the columns in the datagrid. And i am able to do the same by overriding MouseDown event. However, i need to rebind my datatable to reflect the changes in...
7
4796
by: Kamal | last post by:
Hello all, I have a very simple html table with collapsible rows and sorting capabilities. The collapsible row is hidden with css rule (display:none). When one clicks in the left of the...
1
7166
KevinADC
by: KevinADC | last post by:
Introduction In part one we discussed the default sort function. In part two we will discuss more advanced techniques you can use to sort data. Some of the techniques might introduce unfamiliar...
5
3165
by: lemlimlee | last post by:
hello, this is the task i need to do: For this task, you are to develop a Java program that allows a user to search or sort an array of numbers using an algorithm that the user chooses. The...
5
4902
by: jrod11 | last post by:
hi, I found a jquery html table sorting code i have implemented. I am trying to figure out how to edit how many colums there are, but every time i remove code that I think controls how many colums...
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7467
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5594
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5022
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4688
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3177
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
399
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.