datagrid OnCancelCommand

Discussion in 'ASP .Net' started by Brent Burkart, Nov 17, 2003.

  1. My datagrid OnCancelCommand event is not firing.

    HTML
    OnCancelCommand="AdminGrid_Cancel"

    'Code Behind
    Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
    DataGridCommandEventArgs)
    AdminGrid.EditItemIndex = -1
    BindData()
    End Sub

    Does anyone have any clues as to why it is not firing?
    Thanks,
    Brent
    Brent Burkart, Nov 17, 2003
    #1
    1. Advertising

  2. Brent Burkart wrote:

    > My datagrid OnCancelCommand event is not firing.
    >
    > HTML
    > OnCancelCommand="AdminGrid_Cancel"
    >
    > 'Code Behind
    > Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
    > DataGridCommandEventArgs)
    > AdminGrid.EditItemIndex = -1
    > BindData()
    > End Sub
    >
    > Does anyone have any clues as to why it is not firing?
    > Thanks,
    > Brent
    >
    >


    Brent,

    If you are using VS.Net IDE, i had quite the same experience. Try
    investigating by looking at the actual declaration of the hook-events
    delegation. For some reason, sometimes, the IDE is taking out this
    delegation.

    hth,
    Jonel
    Jonel Rienton, Nov 17, 2003
    #2
    1. Advertising

  3. Thank Jonel,

    I guess I am not sure what you are telling me.

    I did add the handler keyword such as the following:

    Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
    DataGridCommandEventArgs) Handles AdminGrid.CancelCommand

    This didn't seem to do anything.

    I am new to .NET. I am not sure what you mean by delegation.

    Thanks for your patience.

    Brent

    "Jonel Rienton" <csharp@nospam_.core.com> wrote in message
    news:3FB92857.9020207@nospam_.core.com...
    > Brent Burkart wrote:
    >
    > > My datagrid OnCancelCommand event is not firing.
    > >
    > > HTML
    > > OnCancelCommand="AdminGrid_Cancel"
    > >
    > > 'Code Behind
    > > Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
    > > DataGridCommandEventArgs)
    > > AdminGrid.EditItemIndex = -1
    > > BindData()
    > > End Sub
    > >
    > > Does anyone have any clues as to why it is not firing?
    > > Thanks,
    > > Brent
    > >
    > >

    >
    > Brent,
    >
    > If you are using VS.Net IDE, i had quite the same experience. Try
    > investigating by looking at the actual declaration of the hook-events
    > delegation. For some reason, sometimes, the IDE is taking out this
    > delegation.
    >
    > hth,
    > Jonel
    >
    Brent Burkart, Nov 17, 2003
    #3
  4. Brent,

    1) are you using VS.Net? or are you using another IDE?
    2) i'm more of a C# developer, so i'll try to give it a shot here

    aren't you, in VB.Net, supposed to declare an event-hook handler
    somewhere(Page_Load,Page_Init) like:

    AddHandler AdminGrid.CancelCommand, AddressOf AdminGrid_Cancel

    let me know how it goes,

    Jonel


    Brent Burkart wrote:

    > Thank Jonel,
    >
    > I guess I am not sure what you are telling me.
    >
    > I did add the handler keyword such as the following:
    >
    > Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
    > DataGridCommandEventArgs) Handles AdminGrid.CancelCommand
    >
    > This didn't seem to do anything.
    >
    > I am new to .NET. I am not sure what you mean by delegation.
    >
    > Thanks for your patience.
    >
    > Brent
    >
    > "Jonel Rienton" <csharp@nospam_.core.com> wrote in message
    > news:3FB92857.9020207@nospam_.core.com...
    >
    >>Brent Burkart wrote:
    >>
    >>
    >>>My datagrid OnCancelCommand event is not firing.
    >>>
    >>>HTML
    >>>OnCancelCommand="AdminGrid_Cancel"
    >>>
    >>>'Code Behind
    >>>Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
    >>>DataGridCommandEventArgs)
    >>> AdminGrid.EditItemIndex = -1
    >>> BindData()
    >>>End Sub
    >>>
    >>>Does anyone have any clues as to why it is not firing?
    >>>Thanks,
    >>>Brent
    >>>
    >>>

    >>
    >>Brent,
    >>
    >>If you are using VS.Net IDE, i had quite the same experience. Try
    >>investigating by looking at the actual declaration of the hook-events
    >>delegation. For some reason, sometimes, the IDE is taking out this
    >>delegation.
    >>
    >>hth,
    >>Jonel
    >>

    >
    >
    >
    Jonel Rienton, Nov 17, 2003
    #4
  5. Thanks Jonel,

    I am using VS.NET and you were correct in adding the AddHandler statement.
    However, the event is still not firing. I appreciate your help because I am
    at a loss.

    Thanks,
    Brent
    "Jonel Rienton" <csharp@nospam_.core.com> wrote in message
    news:3FB940F6.2060004@nospam_.core.com...
    > Brent,
    >
    > 1) are you using VS.Net? or are you using another IDE?
    > 2) i'm more of a C# developer, so i'll try to give it a shot here
    >
    > aren't you, in VB.Net, supposed to declare an event-hook handler
    > somewhere(Page_Load,Page_Init) like:
    >
    > AddHandler AdminGrid.CancelCommand, AddressOf AdminGrid_Cancel
    >
    > let me know how it goes,
    >
    > Jonel
    >
    >
    > Brent Burkart wrote:
    >
    > > Thank Jonel,
    > >
    > > I guess I am not sure what you are telling me.
    > >
    > > I did add the handler keyword such as the following:
    > >
    > > Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
    > > DataGridCommandEventArgs) Handles AdminGrid.CancelCommand
    > >
    > > This didn't seem to do anything.
    > >
    > > I am new to .NET. I am not sure what you mean by delegation.
    > >
    > > Thanks for your patience.
    > >
    > > Brent
    > >
    > > "Jonel Rienton" <csharp@nospam_.core.com> wrote in message
    > > news:3FB92857.9020207@nospam_.core.com...
    > >
    > >>Brent Burkart wrote:
    > >>
    > >>
    > >>>My datagrid OnCancelCommand event is not firing.
    > >>>
    > >>>HTML
    > >>>OnCancelCommand="AdminGrid_Cancel"
    > >>>
    > >>>'Code Behind
    > >>>Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
    > >>>DataGridCommandEventArgs)
    > >>> AdminGrid.EditItemIndex = -1
    > >>> BindData()
    > >>>End Sub
    > >>>
    > >>>Does anyone have any clues as to why it is not firing?
    > >>>Thanks,
    > >>>Brent
    > >>>
    > >>>
    > >>
    > >>Brent,
    > >>
    > >>If you are using VS.Net IDE, i had quite the same experience. Try
    > >>investigating by looking at the actual declaration of the hook-events
    > >>delegation. For some reason, sometimes, the IDE is taking out this
    > >>delegation.
    > >>
    > >>hth,
    > >>Jonel
    > >>

    > >
    > >
    > >

    >
    >
    Brent Burkart, Nov 17, 2003
    #5
  6. Brent,

    let's take this one step at a time, insert a Debug.WriteLine statement
    in your event handler like:

    'Code Behind
    Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
    DataGridCommandEventArgs)
    System.Diagnostics.Debug.WriteLine("admingrid_cancel called")
    AdminGrid.EditItemIndex = -1
    BindData()
    End Sub

    then run your webapp in debug mode and look at your debug window as you
    test your application.

    Brent Burkart wrote:

    > Thanks Jonel,
    >
    > I am using VS.NET and you were correct in adding the AddHandler statement.
    > However, the event is still not firing. I appreciate your help because I am
    > at a loss.
    >
    > Thanks,
    > Brent
    > "Jonel Rienton" <csharp@nospam_.core.com> wrote in message
    > news:3FB940F6.2060004@nospam_.core.com...
    >
    >>Brent,
    >>
    >>1) are you using VS.Net? or are you using another IDE?
    >>2) i'm more of a C# developer, so i'll try to give it a shot here
    >>
    >> aren't you, in VB.Net, supposed to declare an event-hook handler
    >>somewhere(Page_Load,Page_Init) like:
    >>
    >>AddHandler AdminGrid.CancelCommand, AddressOf AdminGrid_Cancel
    >>
    >>let me know how it goes,
    >>
    >>Jonel
    >>
    >>
    >>Brent Burkart wrote:
    >>
    >>
    >>>Thank Jonel,
    >>>
    >>>I guess I am not sure what you are telling me.
    >>>
    >>>I did add the handler keyword such as the following:
    >>>
    >>>Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
    >>>DataGridCommandEventArgs) Handles AdminGrid.CancelCommand
    >>>
    >>>This didn't seem to do anything.
    >>>
    >>>I am new to .NET. I am not sure what you mean by delegation.
    >>>
    >>>Thanks for your patience.
    >>>
    >>>Brent
    >>>
    >>>"Jonel Rienton" <csharp@nospam_.core.com> wrote in message
    >>>news:3FB92857.9020207@nospam_.core.com...
    >>>
    >>>
    >>>>Brent Burkart wrote:
    >>>>
    >>>>
    >>>>
    >>>>>My datagrid OnCancelCommand event is not firing.
    >>>>>
    >>>>>HTML
    >>>>>OnCancelCommand="AdminGrid_Cancel"
    >>>>>
    >>>>>'Code Behind
    >>>>>Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
    >>>>>DataGridCommandEventArgs)
    >>>>> AdminGrid.EditItemIndex = -1
    >>>>> BindData()
    >>>>>End Sub
    >>>>>
    >>>>>Does anyone have any clues as to why it is not firing?
    >>>>>Thanks,
    >>>>>Brent
    >>>>>
    >>>>>
    >>>>
    >>>>Brent,
    >>>>
    >>>>If you are using VS.Net IDE, i had quite the same experience. Try
    >>>>investigating by looking at the actual declaration of the hook-events
    >>>>delegation. For some reason, sometimes, the IDE is taking out this
    >>>>delegation.
    >>>>
    >>>>hth,
    >>>>Jonel
    >>>>
    >>>
    >>>
    >>>

    >>

    >
    >
    Jonel Rienton, Nov 17, 2003
    #6
  7. Thanks Jonel,

    I really appreciate your help. I do set a breakpoint and it never hits my
    events. I also put the debug statement in and nothing.

    I should tell you my AdminGrid_UpdateCommand will not fire either. I don't
    know if that sheds any light on anything or not.

    Thanks,
    Brent
    "Jonel Rienton" <csharp@nospam_.core.com> wrote in message
    news:3FB94C58.4040503@nospam_.core.com...
    > Brent,
    >
    > let's take this one step at a time, insert a Debug.WriteLine statement
    > in your event handler like:
    >
    > 'Code Behind
    > Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
    > DataGridCommandEventArgs)
    > System.Diagnostics.Debug.WriteLine("admingrid_cancel called")
    > AdminGrid.EditItemIndex = -1
    > BindData()
    > End Sub
    >
    > then run your webapp in debug mode and look at your debug window as you
    > test your application.
    >
    > Brent Burkart wrote:
    >
    > > Thanks Jonel,
    > >
    > > I am using VS.NET and you were correct in adding the AddHandler

    statement.
    > > However, the event is still not firing. I appreciate your help because

    I am
    > > at a loss.
    > >
    > > Thanks,
    > > Brent
    > > "Jonel Rienton" <csharp@nospam_.core.com> wrote in message
    > > news:3FB940F6.2060004@nospam_.core.com...
    > >
    > >>Brent,
    > >>
    > >>1) are you using VS.Net? or are you using another IDE?
    > >>2) i'm more of a C# developer, so i'll try to give it a shot here
    > >>
    > >> aren't you, in VB.Net, supposed to declare an event-hook handler
    > >>somewhere(Page_Load,Page_Init) like:
    > >>
    > >>AddHandler AdminGrid.CancelCommand, AddressOf AdminGrid_Cancel
    > >>
    > >>let me know how it goes,
    > >>
    > >>Jonel
    > >>
    > >>
    > >>Brent Burkart wrote:
    > >>
    > >>
    > >>>Thank Jonel,
    > >>>
    > >>>I guess I am not sure what you are telling me.
    > >>>
    > >>>I did add the handler keyword such as the following:
    > >>>
    > >>>Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
    > >>>DataGridCommandEventArgs) Handles AdminGrid.CancelCommand
    > >>>
    > >>>This didn't seem to do anything.
    > >>>
    > >>>I am new to .NET. I am not sure what you mean by delegation.
    > >>>
    > >>>Thanks for your patience.
    > >>>
    > >>>Brent
    > >>>
    > >>>"Jonel Rienton" <csharp@nospam_.core.com> wrote in message
    > >>>news:3FB92857.9020207@nospam_.core.com...
    > >>>
    > >>>
    > >>>>Brent Burkart wrote:
    > >>>>
    > >>>>
    > >>>>
    > >>>>>My datagrid OnCancelCommand event is not firing.
    > >>>>>
    > >>>>>HTML
    > >>>>>OnCancelCommand="AdminGrid_Cancel"
    > >>>>>
    > >>>>>'Code Behind
    > >>>>>Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
    > >>>>>DataGridCommandEventArgs)
    > >>>>> AdminGrid.EditItemIndex = -1
    > >>>>> BindData()
    > >>>>>End Sub
    > >>>>>
    > >>>>>Does anyone have any clues as to why it is not firing?
    > >>>>>Thanks,
    > >>>>>Brent
    > >>>>>
    > >>>>>
    > >>>>
    > >>>>Brent,
    > >>>>
    > >>>>If you are using VS.Net IDE, i had quite the same experience. Try
    > >>>>investigating by looking at the actual declaration of the hook-events
    > >>>>delegation. For some reason, sometimes, the IDE is taking out this
    > >>>>delegation.
    > >>>>
    > >>>>hth,
    > >>>>Jonel
    > >>>>
    > >>>
    > >>>
    > >>>
    > >>

    > >
    > >

    >
    Brent Burkart, Nov 17, 2003
    #7
  8. Brent,

    are you hooking up the events manually or are you letting VS.Net IDE do
    it for you? if the latter, check to make sure that the IDE is indeed
    hooking up the events and the eventhandlers.

    Jonel

    [1] you can send me a snippet of your code offline if you'd like so i
    can take a look at it.

    Brent Burkart wrote:

    > Thanks Jonel,
    >
    > I really appreciate your help. I do set a breakpoint and it never hits my
    > events. I also put the debug statement in and nothing.
    >
    > I should tell you my AdminGrid_UpdateCommand will not fire either. I don't
    > know if that sheds any light on anything or not.
    >
    > Thanks,
    > Brent
    > "Jonel Rienton" <csharp@nospam_.core.com> wrote in message
    > news:3FB94C58.4040503@nospam_.core.com...
    >
    >>Brent,
    >>
    >>let's take this one step at a time, insert a Debug.WriteLine statement
    >>in your event handler like:
    >>
    >>'Code Behind
    >>Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
    >>DataGridCommandEventArgs)
    >> System.Diagnostics.Debug.WriteLine("admingrid_cancel called")
    >> AdminGrid.EditItemIndex = -1
    >> BindData()
    >>End Sub
    >>
    >>then run your webapp in debug mode and look at your debug window as you
    >>test your application.
    >>
    >>Brent Burkart wrote:
    >>
    >>
    >>>Thanks Jonel,
    >>>
    >>>I am using VS.NET and you were correct in adding the AddHandler

    >
    > statement.
    >
    >>>However, the event is still not firing. I appreciate your help because

    >
    > I am
    >
    >>>at a loss.
    >>>
    >>>Thanks,
    >>>Brent
    >>>"Jonel Rienton" <csharp@nospam_.core.com> wrote in message
    >>>news:3FB940F6.2060004@nospam_.core.com...
    >>>
    >>>
    >>>>Brent,
    >>>>
    >>>>1) are you using VS.Net? or are you using another IDE?
    >>>>2) i'm more of a C# developer, so i'll try to give it a shot here
    >>>>
    >>>> aren't you, in VB.Net, supposed to declare an event-hook handler
    >>>>somewhere(Page_Load,Page_Init) like:
    >>>>
    >>>>AddHandler AdminGrid.CancelCommand, AddressOf AdminGrid_Cancel
    >>>>
    >>>>let me know how it goes,
    >>>>
    >>>>Jonel
    >>>>
    >>>>
    >>>>Brent Burkart wrote:
    >>>>
    >>>>
    >>>>
    >>>>>Thank Jonel,
    >>>>>
    >>>>>I guess I am not sure what you are telling me.
    >>>>>
    >>>>>I did add the handler keyword such as the following:
    >>>>>
    >>>>>Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
    >>>>>DataGridCommandEventArgs) Handles AdminGrid.CancelCommand
    >>>>>
    >>>>>This didn't seem to do anything.
    >>>>>
    >>>>>I am new to .NET. I am not sure what you mean by delegation.
    >>>>>
    >>>>>Thanks for your patience.
    >>>>>
    >>>>>Brent
    >>>>>
    >>>>>"Jonel Rienton" <csharp@nospam_.core.com> wrote in message
    >>>>>news:3FB92857.9020207@nospam_.core.com...
    >>>>>
    >>>>>
    >>>>>
    >>>>>>Brent Burkart wrote:
    >>>>>>
    >>>>>>
    >>>>>>
    >>>>>>
    >>>>>>>My datagrid OnCancelCommand event is not firing.
    >>>>>>>
    >>>>>>>HTML
    >>>>>>>OnCancelCommand="AdminGrid_Cancel"
    >>>>>>>
    >>>>>>>'Code Behind
    >>>>>>>Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
    >>>>>>>DataGridCommandEventArgs)
    >>>>>>> AdminGrid.EditItemIndex = -1
    >>>>>>> BindData()
    >>>>>>>End Sub
    >>>>>>>
    >>>>>>>Does anyone have any clues as to why it is not firing?
    >>>>>>>Thanks,
    >>>>>>>Brent
    >>>>>>>
    >>>>>>>
    >>>>>>
    >>>>>>Brent,
    >>>>>>
    >>>>>>If you are using VS.Net IDE, i had quite the same experience. Try
    >>>>>>investigating by looking at the actual declaration of the hook-events
    >>>>>>delegation. For some reason, sometimes, the IDE is taking out this
    >>>>>>delegation.
    >>>>>>
    >>>>>>hth,
    >>>>>>Jonel
    >>>>>>
    >>>>>
    >>>>>
    >>>>>
    >>>

    >
    >
    Jonel Rienton, Nov 18, 2003
    #8
  9. Jonel,

    Here is the code. Thanks so much for your help

    HTML


    <form runat="server">

    <asp:DataGrid runat="server" id="AdminGrid" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" BackColor="White" CellPadding="3" Width="742px" Height="231px" DataKeyField="ProductID" AutoGenerateColumns="False" OnEditCommand="AdminGrid_EditCommand" OnCancelCommand="AdminGrid_CancelCommand" OnUpdateCommand="AdminGrid_UpdateCommand">

    <SelectedItemStyle Font-Bold="True" ForeColor="White" BackColor="#669999"></SelectedItemStyle>

    <ItemStyle ForeColor="#000066"></ItemStyle>

    <HeaderStyle Font-Bold="True" ForeColor="White" BackColor="#006699"></HeaderStyle>

    <FooterStyle ForeColor="#000066" BackColor="White"></FooterStyle>

    <Columns>

    <asp:EditCommandColumn ButtonType="LinkButton" UpdateText="Update" CancelText="Cancel" EditText="Edit"></asp:EditCommandColumn>

    <asp:BoundColumn DataField="ModelName" HeaderText="Product Name"></asp:BoundColumn>

    <asp:BoundColumn DataField="ModelNumber" HeaderText="Product Number"></asp:BoundColumn>

    <asp:BoundColumn DataField="ProductImage" HeaderText="Product Image"></asp:BoundColumn>

    <asp:BoundColumn DataField="itemcount" HeaderText="Item Count">

    <HeaderStyle Width="35px"></HeaderStyle>

    </asp:BoundColumn>

    <asp:HyperLinkColumn Text="Level Setup" DataNavigateUrlField="ProductID" NavigateUrl="AdminPrice.aspx?id={0}">

    <HeaderStyle Width="35px"></HeaderStyle>

    </asp:HyperLinkColumn>

    <asp:BoundColumn DataField="description" HeaderText="Description">

    <HeaderStyle Width="150px"></HeaderStyle>

    </asp:BoundColumn>

    </Columns>

    <PagerStyle HorizontalAlign="Left" ForeColor="#000066" BackColor="White" Mode="NumericPages"></PagerStyle>

    </asp:DataGrid></form>



    'Code Behind


    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    If Not Page.IsPostBack Then

    BindData()

    End If

    AddHandler AdminGrid.CancelCommand, AddressOf AdminGrid_CancelCommand

    AddHandler AdminGrid.UpdateCommand, AddressOf AdminGrid_UpdateCommand

    End Sub

    Sub BindData()

    Dim CategoryID As Integer = CInt(Request.Params("categoryid"))



    ' Obtain Product Details

    Dim products As ProductsDB = New ProductsDB()





    ' Databind Gridcontrol with Shopping Cart Items

    AdminGrid.DataSource = products.GetCompleteProductDetails(CategoryID)

    AdminGrid.DataBind()





    End Sub

    Private Sub AdminGrid_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AdminGrid.SelectedIndexChanged



    End Sub

    Sub AdminGrid_EditCommand(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)

    AdminGrid.EditItemIndex = e.Item.ItemIndex

    BindData()

    End Sub

    Sub AdminGrid_CancelCommand(ByVal sender As Object, ByVal e As DataGridCommandEventArgs) Handles AdminGrid.CancelCommand

    System.Diagnostics.Debug.WriteLine("admingrid_cancel called")

    AdminGrid.EditItemIndex = -1

    BindData()

    End Sub



    Sub AdminGrid_UpdateCommand(ByVal sender As Object, ByVal e As DataGridCommandEventArgs) Handles AdminGrid.UpdateCommand



    Dim product As ASPNET.StarterKit.Commerce.ProductsDB = New ASPNET.StarterKit.Commerce.ProductsDB()

    'Iterate through all rows within datagrid



    Dim i As Integer

    For i = 0 To AdminGrid.Items.Count - 1

    Dim ProductIdTxt As TextBox = CType(AdminGrid.Items(i).FindControl("productid"), TextBox)

    Dim ModelNumberTxt As TextBox = CType(AdminGrid.Items(i).FindControl("ModelNumber"), TextBox)

    Dim ModelNameTxt As TextBox = CType(AdminGrid.Items(i).FindControl("ModelName"), TextBox)

    Dim ProductImageTxt As TextBox = CType(AdminGrid.Items(i).FindControl("ProductImage"), TextBox)

    Dim DescriptionTxt As TextBox = CType(AdminGrid.Items(i).FindControl("Description"), TextBox)

    Dim ItemCountTxt As TextBox = CType(AdminGrid.Items(i).FindControl("ItemCount"), TextBox)

    Dim ProductId As Integer

    Dim ModelNumber As String

    Dim ModelName As String

    Dim ProductImage As String

    Dim Description As String

    Dim ItemCount As Integer



    product.UpdateDetails(ProductId, ModelNumber, ModelName, ProductImage, Description, ItemCount)



    AdminGrid.EditItemIndex = -1

    BindData()

    Next

    End Sub

    "Jonel Rienton" <csharp@nospam_.core.com> wrote in message news:3FB98ECA.1070309@nospam_.core.com...

    > Brent,
    >
    > are you hooking up the events manually or are you letting VS.Net IDE do
    > it for you? if the latter, check to make sure that the IDE is indeed
    > hooking up the events and the eventhandlers.
    >
    > Jonel
    >
    > [1] you can send me a snippet of your code offline if you'd like so i
    > can take a look at it.
    >
    > Brent Burkart wrote:
    >
    > > Thanks Jonel,
    > >
    > > I really appreciate your help. I do set a breakpoint and it never hits my
    > > events. I also put the debug statement in and nothing.
    > >
    > > I should tell you my AdminGrid_UpdateCommand will not fire either. I don't
    > > know if that sheds any light on anything or not.
    > >
    > > Thanks,
    > > Brent
    > > "Jonel Rienton" <csharp@nospam_.core.com> wrote in message
    > > news:3FB94C58.4040503@nospam_.core.com...
    > >
    > >>Brent,
    > >>
    > >>let's take this one step at a time, insert a Debug.WriteLine statement
    > >>in your event handler like:
    > >>
    > >>'Code Behind
    > >>Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
    > >>DataGridCommandEventArgs)
    > >> System.Diagnostics.Debug.WriteLine("admingrid_cancel called")
    > >> AdminGrid.EditItemIndex = -1
    > >> BindData()
    > >>End Sub
    > >>
    > >>then run your webapp in debug mode and look at your debug window as you
    > >>test your application.
    > >>
    > >>Brent Burkart wrote:
    > >>
    > >>
    > >>>Thanks Jonel,
    > >>>
    > >>>I am using VS.NET and you were correct in adding the AddHandler

    > >
    > > statement.
    > >
    > >>>However, the event is still not firing. I appreciate your help because

    > >
    > > I am
    > >
    > >>>at a loss.
    > >>>
    > >>>Thanks,
    > >>>Brent
    > >>>"Jonel Rienton" <csharp@nospam_.core.com> wrote in message
    > >>>news:3FB940F6.2060004@nospam_.core.com...
    > >>>
    > >>>
    > >>>>Brent,
    > >>>>
    > >>>>1) are you using VS.Net? or are you using another IDE?
    > >>>>2) i'm more of a C# developer, so i'll try to give it a shot here
    > >>>>
    > >>>> aren't you, in VB.Net, supposed to declare an event-hook handler
    > >>>>somewhere(Page_Load,Page_Init) like:
    > >>>>
    > >>>>AddHandler AdminGrid.CancelCommand, AddressOf AdminGrid_Cancel
    > >>>>
    > >>>>let me know how it goes,
    > >>>>
    > >>>>Jonel
    > >>>>
    > >>>>
    > >>>>Brent Burkart wrote:
    > >>>>
    > >>>>
    > >>>>
    > >>>>>Thank Jonel,
    > >>>>>
    > >>>>>I guess I am not sure what you are telling me.
    > >>>>>
    > >>>>>I did add the handler keyword such as the following:
    > >>>>>
    > >>>>>Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
    > >>>>>DataGridCommandEventArgs) Handles AdminGrid.CancelCommand
    > >>>>>
    > >>>>>This didn't seem to do anything.
    > >>>>>
    > >>>>>I am new to .NET. I am not sure what you mean by delegation.
    > >>>>>
    > >>>>>Thanks for your patience.
    > >>>>>
    > >>>>>Brent
    > >>>>>
    > >>>>>"Jonel Rienton" <csharp@nospam_.core.com> wrote in message
    > >>>>>news:3FB92857.9020207@nospam_.core.com...
    > >>>>>
    > >>>>>
    > >>>>>
    > >>>>>>Brent Burkart wrote:
    > >>>>>>
    > >>>>>>
    > >>>>>>
    > >>>>>>
    > >>>>>>>My datagrid OnCancelCommand event is not firing.
    > >>>>>>>
    > >>>>>>>HTML
    > >>>>>>>OnCancelCommand="AdminGrid_Cancel"
    > >>>>>>>
    > >>>>>>>'Code Behind
    > >>>>>>>Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
    > >>>>>>>DataGridCommandEventArgs)
    > >>>>>>> AdminGrid.EditItemIndex = -1
    > >>>>>>> BindData()
    > >>>>>>>End Sub
    > >>>>>>>
    > >>>>>>>Does anyone have any clues as to why it is not firing?
    > >>>>>>>Thanks,
    > >>>>>>>Brent
    > >>>>>>>
    > >>>>>>>
    > >>>>>>
    > >>>>>>Brent,
    > >>>>>>
    > >>>>>>If you are using VS.Net IDE, i had quite the same experience. Try
    > >>>>>>investigating by looking at the actual declaration of the hook-events
    > >>>>>>delegation. For some reason, sometimes, the IDE is taking out this
    > >>>>>>delegation.
    > >>>>>>
    > >>>>>>hth,
    > >>>>>>Jonel
    > >>>>>>
    > >>>>>
    > >>>>>
    > >>>>>
    > >>>

    > >
    > >

    >
    Brent Burkart, Nov 18, 2003
    #9
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dave
    Replies:
    0
    Views:
    433
  2. BK Kim

    datagrid in datagrid

    BK Kim, Feb 23, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    530
    Alvin Bruney [MVP]
    Mar 2, 2004
  3. =?Utf-8?B?U3VyZXNo?=
    Replies:
    0
    Views:
    513
    =?Utf-8?B?U3VyZXNo?=
    Mar 2, 2004
  4. Brian K. Williams
    Replies:
    0
    Views:
    535
    Brian K. Williams
    Mar 2, 2004
  5. Andreas Klemt
    Replies:
    0
    Views:
    267
    Andreas Klemt
    Oct 8, 2003
Loading...

Share This Page