i want to have a scroll to be added in the submenu item list.
if im making radmenuItem.DropDownHeight = 200, then i can achieve wat want.
but issue arise when the submenu item are less(say2), then submenuitem list shows 2 submenu item and rest space is show blank, ie. it takes minumun height to the submenu item list as 200.
FUNCTION:
private void AddtoReporMenuItem_OnMouseEnter(object sender, MouseEventArgs e)
{
var treeViewModel = this.DataContext as TreeViewModel;
if(radcontextMenu.Items.Count>2)
radcontextMenu.Items.RemoveAt(2);
RadMenuItem reportItem = new RadMenuItem(){Header = "Add to Report"};
RadMenuItem reportNamesItem;
RadMenuGroupItem reportsList = new RadMenuGroupItem();
if (treeViewModel.Reports != null)
{
foreach (var report in treeViewModel.Reports)
{
reportNamesItem = new RadMenuItem();
reportNamesItem.Header = report.ReportName;
reportNamesItem.Click += (senderObj, eventargs) => reportItem_Click(senderObj, eventargs, report);
reportsList.Items.Add(reportNamesItem);
}
reportItem.Items.Add(reportsList);
reportItem.DropDownHeight = 200;
radcontextMenu.Items.Add(reportItem);
}
}
xaml:
<telerik:RadContextMenu.ContextMenu>
<telerik:RadContextMenu x:Name="radcontextMenu" MouseEnter="AddtoReporMenuItem_OnMouseEnter">
<telerik:RadMenuItem Header="{localization:Translate DeleteTxt}" Command="{Binding Path=DeleteChartDash}" />
<telerik:RadMenuItem Header="{localization:Translate ExportButton}">
<telerik:RadMenuItem Header="CSV" Command="{Binding Path=ExportCommand}" CommandParameter="ExportChart" />
<telerik:RadMenuItem Header="{localization:Translate ExportdataTxt}" Command="{Binding Path=ExportCommand}" CommandParameter="ExportData" />
<telerik:RadMenuItem Header="{localization:Translate PowerPointTxt}" Command="{Binding Path=ExportCommand}" CommandParameter="ExportPPT" />
</telerik:RadMenuItem>
</telerik:RadContextMenu>
</telerik:RadContextMenu.ContextMenu>
if im making radmenuItem.DropDownHeight = 200, then i can achieve wat want.
but issue arise when the submenu item are less(say2), then submenuitem list shows 2 submenu item and rest space is show blank, ie. it takes minumun height to the submenu item list as 200.
FUNCTION:
private void AddtoReporMenuItem_OnMouseEnter(object sender, MouseEventArgs e)
{
var treeViewModel = this.DataContext as TreeViewModel;
if(radcontextMenu.Items.Count>2)
radcontextMenu.Items.RemoveAt(2);
RadMenuItem reportItem = new RadMenuItem(){Header = "Add to Report"};
RadMenuItem reportNamesItem;
RadMenuGroupItem reportsList = new RadMenuGroupItem();
if (treeViewModel.Reports != null)
{
foreach (var report in treeViewModel.Reports)
{
reportNamesItem = new RadMenuItem();
reportNamesItem.Header = report.ReportName;
reportNamesItem.Click += (senderObj, eventargs) => reportItem_Click(senderObj, eventargs, report);
reportsList.Items.Add(reportNamesItem);
}
reportItem.Items.Add(reportsList);
reportItem.DropDownHeight = 200;
radcontextMenu.Items.Add(reportItem);
}
}
xaml:
<telerik:RadContextMenu.ContextMenu>
<telerik:RadContextMenu x:Name="radcontextMenu" MouseEnter="AddtoReporMenuItem_OnMouseEnter">
<telerik:RadMenuItem Header="{localization:Translate DeleteTxt}" Command="{Binding Path=DeleteChartDash}" />
<telerik:RadMenuItem Header="{localization:Translate ExportButton}">
<telerik:RadMenuItem Header="CSV" Command="{Binding Path=ExportCommand}" CommandParameter="ExportChart" />
<telerik:RadMenuItem Header="{localization:Translate ExportdataTxt}" Command="{Binding Path=ExportCommand}" CommandParameter="ExportData" />
<telerik:RadMenuItem Header="{localization:Translate PowerPointTxt}" Command="{Binding Path=ExportCommand}" CommandParameter="ExportPPT" />
</telerik:RadMenuItem>
</telerik:RadContextMenu>
</telerik:RadContextMenu.ContextMenu>