Using the FindBy method

  • Thread starter Greg McAllister
  • Start date
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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top