DataSource. Please, need some help.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • shapper

    DataSource. Please, need some help.

    Hello,

    I am using a LinqDataSource but I could either use an SQLDataSource or
    any other. The question is the same:

    The DataSource is associated with a GridView and I have the following
    event:

    ' lds_Deleting
    Private Sub lds_Deleting(By Val sender As Object, ByVal e As
    LinqDataSourceD eleteEventArgs) Handles lds.Deleting

    End Sub

    When I click a row in the GridView this event is fired.
    I am creating a custom Linq code to delete a record but I need the
    RecordId (PK) of the row clicked.

    How can I get that value in my Deleting event?

    Thanks,
    Miguel
  • Barrie Wilson

    #2
    Re: DataSource. Please, need some help.


    "shapper" <mdmoura@gmail. comwrote in message
    news:931e8a24-97d1-4f91-9748-0542c8a25651@f3 g2000hsg.google groups.com...
    Hello,
    >
    I am using a LinqDataSource but I could either use an SQLDataSource or
    any other. The question is the same:
    >
    The DataSource is associated with a GridView and I have the following
    event:
    >
    ' lds_Deleting
    Private Sub lds_Deleting(By Val sender As Object, ByVal e As
    LinqDataSourceD eleteEventArgs) Handles lds.Deleting
    >
    End Sub
    >
    When I click a row in the GridView this event is fired.
    I am creating a custom Linq code to delete a record but I need the
    RecordId (PK) of the row clicked.
    >
    How can I get that value in my Deleting event?
    maybe this helps (example from the VS2008 docs):

    Protected Sub LinqDataSource_ Deleting(ByVal sender As Object, ByVal e As
    System.Web.UI.W ebControls.Linq DataSourceDelet eEventArgs)
    Dim product As Product
    product = CType(e.Origina lObject, Product)

    If (product.OnSale And Not confirmCheckBox .Checked) Then
    e.Cancel = True
    End If
    End Sub




    Comment

    Working...