sorted table or view

S

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.
 
P

Patrik Löwendahl [C# MVP]

The view is the key,

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

Cor Ligthert

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
 
S

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top