473,657 Members | 2,490 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

sorted table or view

sam
Hello group,
The datagrid is sorted using a dataview. Can I get the
sorted dataview or table from the datagrid or any other way. All I
need to get is the sorted data. Here is my code and what I am trying
to accomplish:
The datagrid is sorted using:

dgWIP.DataSourc e = dvWIP
dvWIP.Sort = Me.SortColumn & " " & Me.SortOrder
dgWIP.DataBind( )
Now, I need to manipulate the sorted data as the order of the rows is
important to me. How do i get the sorted data into a
variable(datata ble/view)? I tried doing something like :
dt = dvwip.table
and stepped thru the code but the dt(table) has the rows in the
original order. Any help would be great!!

Thanks,
Sam.
Jul 21 '05 #1
3 1637
The view is the key,

you have to step through the rows in the view, not the table.

--
Patrik Löwendahl [C# MVP]
www.cshrp.net - "Elegant code by witty programmers"

"sam" <sr*****@mailci ty.com> wrote in message
news:5c******** *************** ***@posting.goo gle.com...
Hello group,
The datagrid is sorted using a dataview. Can I get the
sorted dataview or table from the datagrid or any other way. All I
need to get is the sorted data. Here is my code and what I am trying
to accomplish:
The datagrid is sorted using:

dgWIP.DataSourc e = dvWIP
dvWIP.Sort = Me.SortColumn & " " & Me.SortOrder
dgWIP.DataBind( )
Now, I need to manipulate the sorted data as the order of the rows is
important to me. How do i get the sorted data into a
variable(datata ble/view)? I tried doing something like :
dt = dvwip.table
and stepped thru the code but the dt(table) has the rows in the
original order. Any help would be great!!

Thanks,
Sam.

Jul 21 '05 #2
Hi Sam,

I was telling you how to do that, however because you had written a lot
more, and therefore had the idea that what you was asking was useless to
gave a direct answer for and asked you which of the two alternatives you
choose.

If you think than it is the way in a newsgroup to open a new thread, and not
giving answers back, feel free to do that.

Cor
Jul 21 '05 #3
sam
Hello Group,
I believe, i need to clarify some of my concepts.. When I
assign a table to a dataview, the order of data contained in the
dataview is the same as the data in the dataview after the sort(when I
step thru the rows). But the datagrid(dgwip) displays the data in a
sorted order. Consider the code below"

dvWIP = New DataView(dsWIP1 .Tables(1) -- (1)
dgWIP.DataSourc e = dvWIP
dvWIP.Sort = Me.SortColumn & " " & Me.SortOrder
dgWIP.DataBind( ) -- (2)

I dont see any difference in the dataview when stepped thru the rows.
Is that true?

Thanks,
Sam.


sr*****@mailcit y.com (sam) wrote in message news:<5c******* *************** ****@posting.go ogle.com>...
Hello group,
The datagrid is sorted using a dataview. Can I get the
sorted dataview or table from the datagrid or any other way. All I
need to get is the sorted data. Here is my code and what I am trying
to accomplish:
The datagrid is sorted using:

dgWIP.DataSourc e = dvWIP
dvWIP.Sort = Me.SortColumn & " " & Me.SortOrder
dgWIP.DataBind( )
Now, I need to manipulate the sorted data as the order of the rows is
important to me. How do i get the sorted data into a
variable(datata ble/view)? I tried doing something like :
dt = dvwip.table
and stepped thru the code but the dt(table) has the rows in the
original order. Any help would be great!!

Thanks,
Sam.

Jul 21 '05 #4

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

Similar topics

1
1165
by: J. C. Clay | last post by:
I've created a DataView in C#. I've also sorted my records on product_name. If I return 6000 products and want to get to products (3000-3020) I wrote the following code: WriteView(myView,3000,3020) public void WriteView(DataView myView,int startIdx,int endIdx)
1
1119
by: help | last post by:
I have been on newsgroup for week. I have seen anything that will help me. Basically, I have a form with a datagrid that can be sorted or unsorted (it is up to the user). Then, I display the data of the selected row in textboxes on dialog that execute by the user press a button. The following code works if I do not sort the datagrid before I press the button to bring up the dialog. It is when I sort it the datagrid I have the issue ...
5
1815
by: Jason | last post by:
I've been trying to figure out a good way to do this but haven't had much luck, any input would be greatly appreciated. Basically, after a datagrid is sorted, how can I get the primary key value of the item selected by the user? That is, not the datagrid index 'location' of the item the user selected, but the value inside a column of this item the user clicked on. I would use the CurrencyManager in a windows application but I'm not...
10
4941
by: JohnR | last post by:
I have a datatable as the datasource to a datagrid. The datagrid has a datagridtablestyle defined. I use the datagridtablestyle to change the order of the columns (so they can be different than the column order of the datatable). I also allow the user to click on a column header to sort the datagrid by that column. I need to identify the row and column in the datatable when the user clicks on a cell in the datagrid. Using the...
3
367
by: sam | last post by:
Hello group, The datagrid is sorted using a dataview. Can I get the sorted dataview or table from the datagrid or any other way. All I need to get is the sorted data. Here is my code and what I am trying to accomplish: The datagrid is sorted using: dgWIP.DataSource = dvWIP dvWIP.Sort = Me.SortColumn & " " & Me.SortOrder dgWIP.DataBind()
3
2153
by: Antanas | last post by:
Why is that even though I have added index with DESC sort order on primary key, records in Control Center are displayed by the sequence they were previously inserted, not by the value of primary key? If I perform REORG on table primary index, records get sorted by primary index properly. But when I enter new records afterwards, the new ones appear again sorted in sequence they were inserted into table. Why?
12
3801
by: Cindy Lee | last post by:
When I do a sorta on 1 table, then the other table goes back to the original order. What can I set so, it keeps the order of the other current gridview's order. I set all the gridview values in my 'onpageload' in the cs file.
8
2587
by: Guy | last post by:
Is there a better way to search identical elements in a sorted array list than the following: iIndex = Array.BinarySearch( m_Array, 0, m_Array.Count, aSearchedObject ); aFoundObject= m_Array; m_ResultArray.Add ( aFoundObject);
0
790
by: Alaashamas | last post by:
Hi am facing a problem and i dont know how to deal with it ,i had sql 2000 database that i need to upgrade to sql 2005 , the problem is that i have sorted views in this database but when i convert it to sql 2005 the result of view come unsorted i dont know whether it is a bug in sql 2005 or not but what am suffering of that i had a program that connect to this database and depend on the result of the sorted views (about 180 view ) is there a...
0
8305
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8823
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
8603
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...
0
7320
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5632
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
4151
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
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
1944
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.