I have successfully added some panes programmatically and now would like to remove the same pane programmatically however I cannot work out how to get a reference to the pane I would like to remove by using the name only (this is being called from an external page which does not have a reference to the pane collection).
The code to add my panes:
public void AddPane(String Name, String Type)
{
RadPane panelTable = new RadPane();
panelTable.Header = "Table:" + Name;
panelTable.Title = Name;
panelTable.Name = Name;
aDashTable aPaneTable = new aDashTable();
panelTable.Content = aPaneTable;
radPaneGroupMain.AddItem(panelTable, DockPosition.Left);
}
Attempting to remove my panes with:
public void RemovePane(String Name, String Type)
{
RadPane paneTable = new RadPane();
paneTable = radPaneGroupMain.FindName("Table:" + Name) as RadPane;
radPaneGroupMain.RemovePane(paneTable);
}
But this does not work. The paneTable object is null. Any thoughts?
The code to add my panes:
public void AddPane(String Name, String Type)
{
RadPane panelTable = new RadPane();
panelTable.Header = "Table:" + Name;
panelTable.Title = Name;
panelTable.Name = Name;
aDashTable aPaneTable = new aDashTable();
panelTable.Content = aPaneTable;
radPaneGroupMain.AddItem(panelTable, DockPosition.Left);
}
Attempting to remove my panes with:
public void RemovePane(String Name, String Type)
{
RadPane paneTable = new RadPane();
paneTable = radPaneGroupMain.FindName("Table:" + Name) as RadPane;
radPaneGroupMain.RemovePane(paneTable);
}
But this does not work. The paneTable object is null. Any thoughts?