I am using Nested User Controls….
Like: I have a ‘A’ User control that contains the grid view then a ‘B’ User Control that contains ‘A’ and one more user control then a ‘C’ user Control that Contains ‘B’ and 2 more user controls…
I want row command in the ‘C’ user control
Thanks in advance
Here is two ways that you can achieve this.
Expose the grid view with a public property in your A control. In your B control expose the A control as a public property. So in your C control you can write something like
Or you can define an event on A control such as OnInnerGridRowCommand and raise this event to B control when RowCommand happens. Define another event in B control and raise this new event with appropriate parameters when OnInnerGridRowCommand of A happens. So you can handle this new event in control C.
This is C user control exposing inner grid
This is B user control exposing C
This is A user control exposing B
And this is a page, hosting A user control and attaching to RowCommand,