Cor,
I'm not sure you understood.
I can do this now - capture the column header right click and change the
binding source sort to "". See code below.
I wanted to know if the datagridview ALREADY has a built-in method to do
this. For example when you left click on the left header column above the
row marker, you select all the rows in the grid. Is there something that
will unsort the grid that is already in the datagridview component?
Private Sub gridPOItems_ColumnHeaderMouseClick(ByVal sender As
System.Object, ByVal e As
System.Windows.Forms.DataGridViewCellMouseEventArg s) Handles
gridPOItems.ColumnHeaderMouseClick
If e.Button = Windows.Forms.MouseButtons.Right Then
If gridPOItems.SortedColumn IsNot Nothing Then
POItemsbind.Sort = ""
End If
End If
End Sub
Rick
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:Ov**************@TK2MSFTNGP03.phx.gbl...
Rick,
I never tried it, but can you use the dataview for the datasource and than
set the sort attribute to its initial which is "".
Please give us the result if this works.
Cor
"Rick" <Ri**@LakeValleySeed.comschreef in bericht
news:%2****************@TK2MSFTNGP02.phx.gbl...
>VS 2005/Pro
I'm using a DataGridView in a Windows form and allowing the user to sort
the columns by clicking on the header column.
Is there some method offered by the grid to return back to the unsorted
view?
I think I could "roll my own" by resetting the bindingsource.sort =
nothing, but it seems like the datagridview should have something like
this?
Rick