G
Greg McAllister
I am attempting to use the FindBy... method as described in Walkthrough
document for the DataGrid Web Control. It describes the process of locating
the Key in your dataset by extracting it from the GridControl. This was
succesful. I then set up the subroutine as shown in the sample:
Private Sub PreorderItems_UpdateCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs) Handles
PreorderItems.UpdateCommand
Dim qty As String
Dim key As String = PreorderItems.DataKeys(e.Item.ItemIndex).ToString()
Dim tb As TextBox
tb = CType(e.Item.Cells(2).Controls(0), TextBox)
qty = tb.Text
Dim r As PreordDataSet.wPartPrice2Row
r = PreordDataSet.wPartPrice2.FindByBasket_ID(key)
..
..
..
PreOrderAdapter.Update(PreordDataSet1)
PreorderItems.EditItemIndex = -1
PreorderItems.DataBind()
End Sub
The r= line comes up telling me that:
Reference to a non-shared member requires an object reference
I have checked and it seems to me that it should be available because the
class browser sees it and when I go to the definition is shows as Public as
found in the DataSet's VB file:
Public Function FindByBasket_ID(ByVal Basket_ID As Long) As wPartPrice2Row
Return CType(Me.Rows.Find(New Object() {Basket_ID}),wPartPrice2Row)
End Function
Please advise as to what might be missing!
document for the DataGrid Web Control. It describes the process of locating
the Key in your dataset by extracting it from the GridControl. This was
succesful. I then set up the subroutine as shown in the sample:
Private Sub PreorderItems_UpdateCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs) Handles
PreorderItems.UpdateCommand
Dim qty As String
Dim key As String = PreorderItems.DataKeys(e.Item.ItemIndex).ToString()
Dim tb As TextBox
tb = CType(e.Item.Cells(2).Controls(0), TextBox)
qty = tb.Text
Dim r As PreordDataSet.wPartPrice2Row
r = PreordDataSet.wPartPrice2.FindByBasket_ID(key)
..
..
..
PreOrderAdapter.Update(PreordDataSet1)
PreorderItems.EditItemIndex = -1
PreorderItems.DataBind()
End Sub
The r= line comes up telling me that:
Reference to a non-shared member requires an object reference
I have checked and it seems to me that it should be available because the
class browser sees it and when I go to the definition is shows as Public as
found in the DataSet's VB file:
Public Function FindByBasket_ID(ByVal Basket_ID As Long) As wPartPrice2Row
Return CType(Me.Rows.Find(New Object() {Basket_ID}),wPartPrice2Row)
End Function
Please advise as to what might be missing!