You can leave your main page code behind the custom event descriptor from the Treeview control. Then, in the event handler, call the public method in the gridview control.
If control1 is your tree and control2 is your grid control:
Aspx main page (set control1 event handler for the method on this page):
<%@ Register Src="~/Controls/WebUserControl1.ascx" TagName="Control1" TagPrefix="ctrl" %> <%@ Register Src="~/Controls/WebUserControl2.ascx" TagName="Control2" TagPrefix="ctrl" %> <ctrl:Control1 ID="control1" runat="server" OnTreeNodeChanged="Control1_TreeNodeChanged" /> <ctrl:Control2 ID="control2" runat="server" />
Main page code behind:
public void Control1_TreeNodeChanged(object sender, EventArgs e) { control2.ReloadGrid(); }
Tree management code
public event EventHandler TreeNodeChanged; protected void FromYourTreeNodeEvent(object o, EventArgs e) {
Network management code
public void ReloadGrid() {
Crice source share