So, if there is a solution to this, I haven't found it yet after scouring the documentation and the internet.
Using your example in the WPF Demo, I created a custom object for my items that I bind to the RadNavigationView.ItemsSource. Yours was called NavigationItemModel. Mine is called ShellMenuItem. ShellMenuItem inherits from UserControl, and implements INotifyPropertyChanged, and ICommandSource. All bindings to my properties are wired up in the xaml and work great (EXCEPT FOR THE ISEXPANDED PROPERTY. Next, I have several properties that are pulled from a database, or can be set programmatically in code, like Id, ParentId, Header, NodeType, TargetPageType (Page, Window, etc), TargetViewModelType, etc... Just standard properties. These are so I can programmatically send these dynamic items menu items, pulled from a database, to the correct View and ViewModel. ALL OF MY PROPERTIES WORK FINE, and when I click on a menu item, if it is a page, it opens in the frame, if it is a window, it opens a window, etc... Everything works fine, except the IsExpanded. So, here is the issue. I have a property on ShellMenuItem named IsExpanded. When I try to set this property, the ShellMenuItems do not collapse or expand. Again, I have INotifyPropertyChanged implemented.
On the form, I have a toggle button to expand/collpase all items in the RadNavigationView. I have it's Checked event bound to a command in my ViewModel.
<ToggleButton Content="TestExpandAll">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Checked">
<i:InvokeCommandAction Command="{Binding ElementName=_this, Path=DataContext.CmdExpandMenus}" PassEventArgsToCommand="True" />
</i:EventTrigger>
</i:Interaction.Triggers>
</ToggleButton>
public ICommand CmdExpandMenus { get { return new RelayCommand<RoutedEventArgs>(OnExpandMenus); } }
This fires correctly in my code, at which point I loop through the RadNavigationMenu's ItemsSource and set each property to IsExpanded = true; As shown below. The button should expand all items if the togglebutton state IsChecked, else, it should collpase all items. I have also tried to loop through the actual bound list which likewise, does not work. I can not find a way to get at the entire list of RadNavigationViewItems or even cast my items to a RadNavigationViewItem, even though the ItemContainerStyle's target type is RadNavigationViewItem. There has got to be a simpler way to achieve this.
private void OnExpandMenus(RoutedEventArgs? e) { //foreach (var item in this.StaticMenuItems) //{ // item.IsExpanded = true; //} foreach (var shellMenuItem in this.MainMenu.ItemsSource) { var itm = shellMenuItem; var itmType = itm.GetType(); //itmType is ShellMenuItem var menuItem = shellMenuItem as ShellMenuItem; //var targetType = this.MainMenu.ItemContainerStyle.TargetType; //targetType is RadNavigationViewItem menuItem.IsExpanded = true; } }
I have easily achieved this effect on many other controls, and you even have predefined Methods to perform this on controls such as RadTreeViewList.
void treeListView_DataLoaded(object sender, EventArgs e) { treeListView.DataLoaded -= treeListView_DataLoaded; treeListView.ExpandAllHierarchyItems(); }
Can you add a method to the RadNavigationView to ExpandAllHierarchyItems(true/false) or just add 2 methods...
ExpandAllHierarchyItems() and CollapseAllHierarchyItems()
If this is not feasible, then you should update your demo to show how to accomplish this with a custom menu item. Im sure I could make my ShellMenuItem inherit directly from RadNavigationViewItem but in my control library, I dont have any references to Telerik because there are applications that use ShellMenuItem that do not use Telerik at all, and we shouldnt have to make our generic controls inherit from a 3rd party control to make this work. It seems to me that if you have a control that allows a hierarchy of items, and those controls/classes can be expanded or collapsed, then you should ALWAYS add the methods above to those controls/classes. Or perhaps you could create an interface named IExpandable, and any control that you guys create that can be expanded/collapsed, could implement that interface and have access to the ExpandAll/CollapseAll funtionality.
Thanks,
John
Setup: In a WPF Windows Desktop application project, use a RadTabControl with 2 tabs, Tab 1 and Tab 2. Add a RadDocking and some Panes to Tab 1.
Run the application and do:
I've attached a sample project showing the problem, with similar instructions as above. Tested with both 2021.3.1123 and 2022.2.622.
Please advice!
I have a Pie chart like this:
<telerik:RadPieChart Palette="Arctic">
<telerik:DoughnutSeries ItemsSource="{Binding GraphedStatistics, Mode=OneTime}" ValueBinding="Previous" ShowLabels="True">
<telerik:DoughnutSeries.LabelDefinitions>
<telerik:ChartSeriesLabelDefinition>
<telerik:ChartSeriesLabelDefinition.Template>
<DataTemplate>
<StackPanel Opacity="{Binding Value, Mode=OneWay>
<TextBlock Text="{Binding DataItem.Name}" HorizontalAlignment="Center" Foreground="{StaticResource textBlockForeground}"/>
<TextBlock HorizontalAlignment="Center" Foreground="{StaticResource textBlockForeground}">
<Run Text="{Binding Value, Mode=OneWay, StringFormat=' {0:#}'}"/>
<Run Text="{Binding Percent, Mode=OneWay, StringFormat=' ({0:#}%)'}"/>
</TextBlock>
</StackPanel>
</DataTemplate>
</telerik:ChartSeriesLabelDefinition.Template>
</telerik:ChartSeriesLabelDefinition>
</telerik:DoughnutSeries.LabelDefinitions>
</telerik:DoughnutSeries>
If I generate a pie or doughnut chart the Percent is not updated when I update a value in the bound data source (GraphedStatistics). Note: I am updating the observable collection not replacing it. The graph is redrawn correctly and Value updates correctly.
The version is 22.1.1.0 (not in the options below)
Updated (See that 'Monaco' is the same percentage as before the update, Value is correct and the UI Graph is correct but the segment is clearly not 26%)
Hello,
When I do the following:
and I assign this style to my dynamically created columns from a behavior attached to the RadGridView, the style of the tooltip is the same as the style of the header.
They seem to share the same style, so that when I change one property on the header, the tooltip gets the same, and vice-versa.
Do you repro? I'm on version 2020.3.1020.45.
Thanks,
Arthur
Hi Telerik-Team,
on of our user found a bug when you flick with the mouse on resizing a column.
The system crashes. Here is the message and stacktrace:
Message Object reference not set to an instance of an object. StackTrace at Telerik.Windows.Controls.GridView.GridViewHeaderCell.HeaderToResize(Object gripper) at Telerik.Windows.Controls.GridView.GridViewHeaderCell.OnColumnHeaderResize(Object sender, DragDeltaEventArgs e) at System.Windows.Controls.Primitives.DragDeltaEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e) at System.Windows.Controls.Primitives.Thumb.OnMouseMove(MouseEventArgs e) at System.Windows.UIElement.OnMouseMoveThunk(Object sender, MouseEventArgs e) at System.Windows.Input.MouseEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args) at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted) at System.Windows.Input.InputManager.ProcessStagingArea() at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input) at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport) at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel) at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) at System.Windows.Window.ShowHelper(Object booleanBox) at System.Windows.Window.Show() at System.Windows.Window.ShowDialog() at Test_WPF.MainWindow.StartInstance(Type program) in C:\Users\masi\source\repos\NEMO\Test_WPF\MainWindow.xaml.cs:line 51
I have attached two examples. One in our app and a test application.
I hope you can figure out what is going on.
Best regards,
Mats
In Windows 11, when mouse over top level window title bar maximize box, there should be snap layout drop down, but for any child window there should not be snap layout drop down.
I've tested the following 4 cases and all of them works fine
1. win32 project
2. MFC project
3. general Winform project
4. general WPF project.
but for Telerik WPF project which use RadRibbonWindow as main window, the behavior is wrong. as attached video shows
I noticed that you're translating twice the element when it's inside of a container.
Based on your MVVM app:
Select Buggati Veyron
Select with pressed CTRL a Volkswagen Group.
Move Volkswagen group.
Expected : Both items moved the same amount of pixels( or at least property exposed to change it )
Hello i have noticed few weird/wrong behaviors of containers.
Based on your MVVM demo application:
Select node : A4 in Audi group
Select node Volkswagen Group.
Move Volkswagen group by 1px
In such case you removed A4 node from its container, which was dropped correctly.
We are using RadRichText box along with HtmlDataProvider to create new para in specific notes- comments. As our application heavily relay on adding comments in html format when adding/ forwarding application to another user.
As a main control RadRichText box is working fine and dev team is recommending to use it in Production. But issue happens when we are rendering all comments as list associated to one application. Currently we have some application having more than 200 comments.
We used RadRichtext box to render HTML as readonly. but I impacted performance. Page take enough time to load contents.
Currently we replaced RadRichText box with HtmlRenderer.WPF (HtmlPanel) control, which is much efficient compare to Telerik control. However HtmlPanel has its own limitation.
I wish if Telerik has such lightweight control to render HTML content in more efficient way, which does not effect application performance.
To whom it may concern,
In our MVVM-project, we are using a derived implementation of the RadRibbonWindow to add some customized functions, for example to add EventHandlers firing when something changed in the view, for example language or culture setting changes from another window. With the EventToCommandBehavior binding, we would like to pass the fired custom event to our view model to execute an async command. Although the event is not shown for autocompletion, everything works fine during runtime, and the command is executed when the event was fired. Unfortunately, the VisualStudio XAML designer cannot bind the custom event handler for the EventToCommand Behavior tag and therefore shows an exception within the XAML code, and within the XAML designer. Because of that binding problem, we are unable to further use the designer to get a preview of our designed windows.
We tried to derive our window from the basic WPF window (System.Windows.Window) and simply add the custom event handler but it did not work, either. Is there any problem with our implementation, or with the EventToCommandBehavior leading to an exception during design time? I have attached a minimal working example. In the code, I have derived a customized window class from the basic WPF window (shows the same error as the RadRibbonWindow), and have added a new event handler. This window is used as main window and fires the custom event when the event OnContentRendered function is called. The view binds this event within XAML to a command of the view model. The command is implemented with our customized asynchronous command. The XAML designer throws the described exception (as shown in the provided picture) but when I debug the program, a break point set within the function called by the command is hit.
I have removed the package "Telerik.Windows.Controls.for.Wpf.Xaml.2021.3.1109" within the .zip-folder because the code would have exceeded the maximum file size.
Sincerely,
Matthias Jörg
Hello!
I'm in need for a VisibleColumnCount dependency property for RadGridView (or GridViewDataControl I guess).
Just like FrozenColumnCount actually, so I guess this is just a simple dev but I can be wrong?
It would be so helpful, because I have a textbox ("search column with name") that I use to toggle the visibility of the columns in my RadGridView, and I want to do stuff whether there are matching columns (like, displaying a text "No results").
Currently, I'm using a bunch of converters to do the job an it leads to quite ugly and hard-to-maintain code.
Thanks in advance!
Arthur
Currently RadComboBox has no property to prevent user from clearing it with backspace. Also ComboBox SelectedIndex may become -1 when ItemSource is changed.
New propery (CanClear) could be checked on KeyDown event, when item collection is changed or when SelectedItem is changed..
If CanClear is set to false:
Backspace is ignored on KeyDown.
If collection is changed and collection size is greater than 0, ComboBox SelectedIndex becomes 0 automatically.
If SelectedItem becomes null and item collection size is greater than 0, ComboBox attemts to select first non-null item from collection.
Right now, it is not easy to disable styles for standard controls like Button.
Especially when using NoXaml.
You have to create an Empty style on Application level for the control to "rewind" its style.
I do believe this kind of style drags down performance of controls when unloading, since it causes StyleChanged events.
Some explanation about performance (how things work to my understanding). Might be BS, but I spend a few hours debugging through .net code to get this idea:
Issue is, that when control is unloaded, its not part of the logical / visual tree of the application anymore, so it falls back to styles defined on assembly level.
e.g. Themes/Generic.xaml. So the empty styles defined on Application level do not count anymore, but the ones you defined in your theme.
This can be observed on RadTabbedWindow. When unloading pages (like switching between them), controls fall back to the styles defined in the theme from Telerik.Windows.Controls.Navigation, because they are still children of that page.
You can observe this behaviour if you set a Breakpoint in FrameworkElement.OnStyleChanged before unloading a control tree.
If you'd remove the System.Windows.xaml from your theme-dictionaries so that one can decide to merge those styles or not, that would be great.