Talkin about dataview object. Recently I tried to edit some row like this
.... dr(indexcolumn) (indexrow) = "... " .. it was applied to the dataset,
But it didn't update to the datasource when i call
DataAdapter.update(Dataset,"TableName") { this with assumtion that
commandbuilder had been generated }. And also a mistake when i tried to
delete row using dataview object. But it didn't show any error message when
i put the -update method- in try ... catch ... endtry ....
Felling frustated with dataview object .. i used datatable object to edit
and delete row. ... Did u guys have this kind of problems before ?
Martin
"William LaMartin" <la******@tampabay.rr.com> wrote in message
news:u7**************@TK2MSFTNGP09.phx.gbl...
Not tested, but how about something like this:
dim dv As New DataView
dv = ds.Tables(0).DefaultView 'where ds is the dataset in question
dv.Sort = "Order" 'where Order is the column name by which you want to
sort Me.DataGrid1.DataSource = dv
Me.DataGrid1.Refresh()
"Dennis" <De****@discussions.microsoft.com> wrote in message
news:D4**********************************@microsof t.com... Is there someother way such as sending a message to the DAtaGrid via
WinProc
to sort a column? I don't see where the DataView works with DataSets.
"scorpion53061" wrote:
You can use one line of code to create a dataview from the datatable.
Dim dv as DataView = WhateverDataTable.DefaultView
Now, bind the grid to the view instead of the table. All of your
current
functionality will still be in tact.
You can call Sort on any field in the dataview and sort it which will
cause
the grid to sort.You could offer this via a context menu for instance,
if
for some reason you didn't want to allow sorting based on the grid
headers.
http://www.knowdotnet.com/articles/dataviewsort.html
"Dennis" <De****@discussions.microsoft.com> wrote in message
news:10**********************************@microsof t.com:
> How do I sort a DataGrid Column in code without clicking on the
column > header?