Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > create a dataview from a datagrid

Thread Tools

create a dataview from a datagrid

William French
Posts: n/a
Does anyone know how to create a dataview from a datagrid. The
examples I see for sorting are persisting the dataset, datatable, or
dataview in viewstate. It seems like a waste for the datagrid and the
dataview to both be stored in viewstate. Any ideas would be greatly
Reply With Quote
Posts: n/a
One way is to set the DataView Table property to the table that you use
to populate the grid.

Dim dv as New DataView
dv.table = yourDataSet.yourTable
dv.sort "IDField DESC"
DataGrid1.DataSource = dv

*** Sent via Developersdex ***
Don't just participate in USENET...get rewarded for it!
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorted DataView, but unsorted datalist when bound to the dataview CodeMonkey ASP .Net 1 02-04-2011 10:55 AM
DataView, DataGrid sorting and incorrect SelectedIndex ASP .Net 0 07-18-2006 04:55 PM
DataView, DataGrid and IsPostBack ASP .Net 5 01-10-2006 06:21 PM
Create datable/dataview from datagrid fabrice ASP .Net 1 12-15-2005 01:49 AM
Datagrid / Dataview won't sort ASP .Net 1 11-05-2005 01:29 PM