sorted table or view

  • Thread starter Thread starter sam
  • Start date Start date
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.
 
The view is the key,

you have to step through the rows in the view, not the table.
 
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
 
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.
 
Back
Top