This question is locked. New answers and comments are not allowed.
Hello Community,
I was using static binding for Menu, IsCheckable property was working fine.
but, after that when I am using Dynamic binding for menu, IsCheckable property in not working now.
I am refering this link:
http://www.telerik.com/help/silverlight/radmenu-populating-with-data-binding-to-dynamic-data.html
I have changed some code for my purpose
Please Help.
Thanks in advance.
Kiran Ghanwat
I was using static binding for Menu, IsCheckable property was working fine.
but, after that when I am using Dynamic binding for menu, IsCheckable property in not working now.
I am refering this link:
http://www.telerik.com/help/silverlight/radmenu-populating-with-data-binding-to-dynamic-data.html
I have changed some code for my purpose
public ObservableCollection<MenuItem> GetMenuItems(string strChart, List<List<ForecastRatiosChartData>> lstchart, int tag) { ObservableCollection<MenuItem> IncomeStmtSubItems = new ObservableCollection<MenuItem>(); ObservableCollection<MenuItem> ChartSubItems = new ObservableCollection<MenuItem>(); MenuItem newItem; if (lstchart != null) { for (int rowcnt = 0; rowcnt < lstchart.Count; rowcnt++) { if (lstchart[rowcnt].ToList().Count > 1) { newItem = new MenuItem(); newItem.Text = lstchart[rowcnt][0].description.Trim(); newItem.Tag = tag; newItem.IsCheckable = true; newItem.StaysOpenOnClick = true; IncomeStmtSubItems.Add(newItem); } }
} MenuItem Incomestmt = new MenuItem() { SubItems = IncomeStmtSubItems, Text = "Income Statement", Tag=0, IsCheckable = true, StaysOpenOnClick = true, }; ChartSubItems.Add(Incomestmt);
} public class MenuItem { public MenuItem() { this.SubItems = new ObservableCollection<MenuItem>(); } public string Text { get; set; } public int Tag { get; set; } public bool IsCheckable { get; set; } public bool StaysOpenOnClick { get; set; } public Uri IconUrl { get; set; } public Image Icon { get { return new Image() { Source = new BitmapImage(this.IconUrl) }; } } public ObservableCollection<MenuItem> SubItems { get; set; } }Please Help.
Thanks in advance.
Kiran Ghanwat