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 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
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
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
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" <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
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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()...
|
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...
|
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))
...
|
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...
|
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...
| |
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...
|
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...
|
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...
|
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...
|
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...
|
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,...
| |
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,...
|
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...
|
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...
|
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,...
|
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...
|
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...
| |
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...
|
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...
| |