I am building an Ad-Hoc reporting application and would like to be able to add a customized menu to each RadDock presented to the user. Through expirimentation the best I've been able to do is embed a menu into the RadGrid which will be within each dock's command template however this has numerous problems, such as the command template not being displayed when the grid has no data (My menu is intended to allow the user to choose columns which will in turn toggle their visibility).
When I try setting the titlebar template to a custom ITemplate which adds a menu it works in the most primitive sense of actually adding the menu, however the menu items appear to be rendering in the background regardless of any attempts by me to set their z-index. Also, the skin of the dock is lost and the title renders in an odd yellow color. Also, adding multiple controls within the template doesn't appear to work as I want the title to read something along the lines of:
Service Entry Grid <Menu Here> <Minimize Button Here>
Is there a way to have multiple control in the header template correct render along with the skin and the menuitems rendering on the top layer of the page?
Some simple code:
When I try setting the titlebar template to a custom ITemplate which adds a menu it works in the most primitive sense of actually adding the menu, however the menu items appear to be rendering in the background regardless of any attempts by me to set their z-index. Also, the skin of the dock is lost and the title renders in an odd yellow color. Also, adding multiple controls within the template doesn't appear to work as I want the title to read something along the lines of:
Service Entry Grid <Menu Here> <Minimize Button Here>
Is there a way to have multiple control in the header template correct render along with the skin and the menuitems rendering on the top layer of the page?
Some simple code:
protected override void OnInit(EventArgs e) | |||||||||||||||||||||||
{ | |||||||||||||||||||||||
base.OnInit(e); | |||||||||||||||||||||||
// create the rad menu | |||||||||||||||||||||||
RadMenuItem chooseItem = new RadMenuItem("Choose Columns"); | |||||||||||||||||||||||
foreach (ColumnInformation column in (Session[ReadOnlyColumns] as ReadOnlyCollection<ColumnInformation>)) | |||||||||||||||||||||||
{ | |||||||||||||||||||||||
RadMenuItem item = new RadMenuItem(column.Name); | |||||||||||||||||||||||
foreach (ColumnInformation c in (List<ColumnInformation>) Session[ChosenColumns]) | |||||||||||||||||||||||
{ | |||||||||||||||||||||||
if (c.Name == column.Name) | |||||||||||||||||||||||
{ | |||||||||||||||||||||||
item.ImageUrl = "~/images/check.gif"; | |||||||||||||||||||||||
} | |||||||||||||||||||||||
} | |||||||||||||||||||||||
item.Style[HtmlTextWriterStyle.ZIndex] = "0"; | |||||||||||||||||||||||
chooseItem.Items.Add(item); | |||||||||||||||||||||||
} | |||||||||||||||||||||||
RadMenu menu = new RadMenu(); | |||||||||||||||||||||||
menu.Style[HtmlTextWriterStyle.ZIndex] = "0"; | |||||||||||||||||||||||
menu.Skin = "Outlook"; | |||||||||||||||||||||||
menu.ItemClick += new RadMenuEventHandler(menu_ItemClick); | |||||||||||||||||||||||
menu.Items.Add(chooseItem); | |||||||||||||||||||||||
RadDock1.TitlebarTemplate = new ColumnMenuTemplate(menu); | |||||||||||||||||||||||
} | |||||||||||||||||||||||
public class ColumnMenuTemplate : ITemplate { public ColumnMenuTemplate(RadMenu menu) { m_Menu = menu; } private RadMenu m_Menu; #region ITemplate Members public void InstantiateIn(Control container) { Label label = new Label(); label.ID = "foo"; label.Text = "Service Entry Grid"; container.Controls.Add(label); container.Controls.Add(m_Menu); } #endregion }
|