|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Why doesn't changing the position in a table change the position of the DatGridView that's bound toIf I check the row in the table (DataTable2), it IS changing as it should and the DGV IS bound to the data table. Private Sub cmdFirst_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdFirst.Click BindingContext(MyDataSet.Tables("DataTable2")).Position = 0 End Sub Private Sub cmdLast_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdLast.Click BindingContext(MyDataSet.Tables("DataTable2")).Position = MyDataSet.Tables("DataTable2").Rows.Count End Sub Private Sub cmdNext_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdNext.Click If BindingContext(MyDataSet.Tables("DataTable2")).Position < MyDataSet.Tables("DataTable2").Rows.Count Then BindingContext(MyDataSet.Tables("DataTable2")).Position += 1 End If End Sub Private Sub cmdPrevious_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdPrevious.Click If BindingContext(MyDataSet.Tables("DataTable2")).Position > 0 Then BindingContext(MyDataSet.Tables("DataTable2")).Position -= 1 End If End Sub Sam,
In version 2005 it is easier to use the bindingsource. See this sample on our webview http://www.vb-tips.com/default.aspx?ID=869eb278-0b5f-4dfd-8068-4e3f3fedb997 I hope this helps, Cor "Sam Malone" <the_sam_mal***@hotmail.com> schreef in bericht news:eYa6kXfhGHA.4276@TK2MSFTNGP03.phx.gbl... I have these four methods to change the position in a table. However when I invoke any of them nothing appears to happen to the table. It doesn't scroll. The selector pointer doesn't move. Nada!!If I check the row in the table (DataTable2), it IS changing as it should and the DGV IS bound to the data table. Private Sub cmdFirst_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdFirst.Click BindingContext(MyDataSet.Tables("DataTable2")).Position = 0 End Sub Private Sub cmdLast_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdLast.Click BindingContext(MyDataSet.Tables("DataTable2")).Position = MyDataSet.Tables("DataTable2").Rows.Count End Sub Private Sub cmdNext_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdNext.Click If BindingContext(MyDataSet.Tables("DataTable2")).Position < MyDataSet.Tables("DataTable2").Rows.Count Then BindingContext(MyDataSet.Tables("DataTable2")).Position += 1 End If End Sub Private Sub cmdPrevious_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdPrevious.Click If BindingContext(MyDataSet.Tables("DataTable2")).Position > 0 Then BindingContext(MyDataSet.Tables("DataTable2")).Position -= 1 End If End Sub OH GOODIE!!! and just when I thought I was beginning to understand the other stuff :=) Thanks a bunch. I'll have a look at it, Cor. Appreciate the help.
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message news:eUKugZghGHA.5104@TK2MSFTNGP04.phx.gbl... In version 2005 it is easier to use the bindingsource.Sam, See this sample on our webview http://www.vb-tips.com/default.aspx?ID=869eb278-0b5f-4dfd-8068-4e3f3fedb997 I hope this helps, Cor "Sam Malone" <the_sam_mal***@hotmail.com> schreef in bericht news:eYa6kXfhGHA.4276@TK2MSFTNGP03.phx.gbl... I have these four methods to change the position in a table. However when I invoke any of them nothing appears to happen to the table. It doesn't scroll. The selector pointer doesn't move. Nada!!If I check the row in the table (DataTable2), it IS changing as it should and the DGV IS bound to the data table. Private Sub cmdFirst_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdFirst.Click BindingContext(MyDataSet.Tables("DataTable2")).Position = 0 End Sub Private Sub cmdLast_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdLast.Click BindingContext(MyDataSet.Tables("DataTable2")).Position = MyDataSet.Tables("DataTable2").Rows.Count End Sub Private Sub cmdNext_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdNext.Click If BindingContext(MyDataSet.Tables("DataTable2")).Position < MyDataSet.Tables("DataTable2").Rows.Count Then BindingContext(MyDataSet.Tables("DataTable2")).Position += 1 End If End Sub Private Sub cmdPrevious_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdPrevious.Click If BindingContext(MyDataSet.Tables("DataTable2")).Position > 0 Then BindingContext(MyDataSet.Tables("DataTable2")).Position -= 1 End If End Sub
Calling VB.Net classes from VB6
VB.NET Screen Stops Refreshing After Losing Focus?? Why choose SQL Express over Access? Offset lines appearing over form after delay (NVIDIA Chipset) Soap Formatter namespace not found UI to enter values into a structure Crypto removing white spaces from byte array Restart, but after a delay Detect Screen Resolution ASPX user interface dilemma |
|||||||||||||||||||||||