ItemCommand event not working in Nested Datagrid through Image Button

Discussion in 'ASP.NET / ASP.NET Core' started by abhi, May 23, 2006.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I have Used Three Datagrid in a nested order.
    In the Item Template of each Datagrid I have a Image Button.
    On clicking the Image Button the next child Datagrid record get filled through
    the ItemCommand Event of the parent datagrid.
    Its working fine for the first datagrid.
    But when I click on the Image Button of the second Datagrid the Item Command event
    doesn't fired and the third datagrid dont' get filled.
    Also, I am unable to get the event of the Image Button clicked on the Second Datagrid.

    Kindly provide solutions to above problem
     
  2. On your inner datagrid, have you populated the 'onclick' attribute and created a corresponding method in your code to accept it?


    Joel Thoms
    DiscountASP.NET
    http://www.DiscountASP.NET
     
  3. yes i have populated "onclick" attributeon the image button of the inner grid on page_load() event,


    but the compiler is not recognising the image button at the page level(as it the the part of inner grid).





    i am getting error:


    "Object reference is not set to an instance of an onbject"


    please suggest some other way.


    reagrds,
     
  4. Without seeing your code, I have no idea whats going on, but I'll try to take a stab in the dark.

    I'm guessing your inner repeater is named something like InnerRepeater and you are calling the method like this...

    Sub InnerRepeater(Byval sender As Object, Byval e As EventArgs)
    Dim xxx As String = InnerRepeater.xxx
    End Sub

    The problem is InnerRepeater is a dynamically created control, so you have to do this...


    Sub InnerRepeater(Byval sender As Object, Byval e As EventArgs)
    Dim InnerRepeater As Repeater = sender
    Dim xxx As String = InnerRepeater.xxx
    End Sub


    Joel Thoms
    DiscountASP.NET
    http://www.DiscountASP.NET
     
  5. thanks joel

    i hv rid out from that problem.

    i used delegats to catch events of inner datagrid.


    abhishek
     
  6. abhi: can you post an example code of what you did? because I'm having the same problem but I still can't resolve it.

    Thanks.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page