473,659 Members | 2,996 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 1252
Nikolay,

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

ds.tables(0).de faultview.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******** ********@TK2MSF TNGP12.phx.gbl. ..
Nikolay,

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

ds.tables(0).de faultview.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.so rt = "column_nam e", 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******** ********@TK2MSF TNGP12.phx.gbl. ..
Nikolay,

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

ds.tables(0).de faultview.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.so rt = "column_nam e", 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*******@usin ternet.com> wrote in message
news:Oe******** ******@TK2MSFTN GP12.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.so rt = "column_nam e", 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
2528
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() sorted_feature_vector.sort() #feature_vector.keys()=sorted_feature_vector
0
2727
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 not the whole page, but a portion of the page. Strangely enough the URL below http://beta.asp.net/QUICKSTARTV20/aspnet/doc/ctrlref/data/gridview.aspx (VB GridView Paging and Sorting Callbacks example)
7
3255
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)) CType(local4, Short) = CType(src, Short)
19
25451
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 sort columns based on the column header the user has clicked in both Ascending and Descending formats.
10
2771
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 write such layers myself I got stuck on how to get filtered or sorted data from the data-layer. This is what I got: Objects
4
3094
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 grid. And with rebinding, sorting image (little triangle on the column header) goes away. I need to show sorting image as well custom sorting. Please help. Thanks
7
4811
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 expandable row, the hidden row is made visible with css. The problem is when i sort the rows, the hidden rows get sorted as well which i don't want and want to be moved (while sorting) relative to their parent rows. The following is my complete html code...
1
7183
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 methods or syntax to a less experienced perl coder. I will post links to online resources you can read if necessary. Experienced perl coders might find nothing new or useful contained in this article. Short Review In part one I showed you some...
5
3179
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 search algorithms that can be used are Linear Search and Binary Search. The sorting algorithms are bubble, selection and Insertion sort. First, the user is asked whether he/she wants to perform a search option, a sort operation, or exit the program. If...
5
4933
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 there are, it crashes. There are currently 6 columns, and I only want 4. How do I remove the last two (discount and date)? Here is a link: http://www.jaredmoore.com/tablesorter/docs/salestable.html Here is some jquery js that I think...
0
8428
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8851
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8627
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6179
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2752
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1976
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.