473,326 Members | 2,805 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

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.DataSource = 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(datatable/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 1609
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*****@mailcity.com> wrote in message
news:5c**************************@posting.google.c om...
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()
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(datatable/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.DataSource = 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*****@mailcity.com (sam) wrote in message news:<5c**************************@posting.google. 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.DataSource = 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(datatable/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
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: ...
1
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...
5
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...
10
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...
3
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...
3
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...
12
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...
8
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;...
0
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.