Hello team,
I am persisting the grid settings. And I have a button in each gridview's control panel as "Reset to default".
I am deleting the related bin file, but the default settings (as stated in xaml) is not being reflected to current grid in screen. I tried, rebinding/re assigning itemssource/InvalidateVisual with no luck. How can i reset the gridview settings, without being have to keep a default bin file and restoring that bin file, when the user clicks "reset to default".

Hello,
We're using the RadRichTextBox control with the Windows8 Theme.
And it's possible to insert an image in the text but as soon as the user tries to select this image to resize it, the application crashes:
An unhandled exception of type 'System.NullReferenceException' occurred in PresentationFramework.dll
At first I thought we were doing something wrong, so I've tried to recreate the problem in one the the sample projects.
By doing so I've noticed that this problem occurs only when using the Windows8 Theme. Changing the theme to Windows7 for example makes the issue disappear. But this is not an actual solution for us, because we'd like to be able to use the Windows8 theme too.
I've attached a screenshot of the exception details. I apologise for it being in Dutch but I believe it still to be of use here.
It says that the resource key RadButtonStyle is missing. I'd like to point out again that this seems to only occur with the Windows8 theme.
To recreate the problem you can use the SaveAndSaveAs_WPF sample project and just set the theme of the RadRichTextBox control to Windows8.
You can just take a screenshot and paste it in the RadRichTextBox, when you try to resize this image the NullReferenceException should be thrown.
Below is an example of the adjusted MainWindow.xaml:
<Window x:Class="SaveAndSaveAs_WPF.MainWindow" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" Title="MainWindow" Height="350" Width="525"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <StackPanel Orientation="Horizontal" Grid.Row="0" > <telerik:RadButton Content="New" Click="NewDocumentButton_Click" Padding="25,5" Margin="5" /> <telerik:RadButton Content="Open" Click="OpenButton_Click" Padding="25,5" Margin="5" /> <telerik:RadButton Content="Save" Click="SaveButton_Click" Margin="5" Padding="25,5"/> <telerik:RadButton Content="Save As" Click="SaveAsButton_Click" Margin="5" Padding="25,5"/> </StackPanel> <telerik:DocumentRuler Grid.Row="1"> <telerik:RadRichTextBox telerik:Analytics.Name="rtb" x:Name="radRichTextBox" IsSpellCheckingEnabled="False" LayoutMode="Paged" AllowDrop="True" > <telerik:RadRichTextBox.Style> <Style TargetType="telerik:RadRichTextBox"> <Setter Property="telerik:StyleManager.Theme" Value="Windows8" /> </Style> </telerik:RadRichTextBox.Style> </telerik:RadRichTextBox> </telerik:DocumentRuler> </Grid></Window>
Is there anything we could to in order to bypass this problem and still use the Windows8 theme?

I have an expander that contains sub-expanders. I want to automatically close the sub-expanders when I close the main expander. I have implemented this logic using data binding, but it doesn't seem to work correctly.
Looks like binding to the IsExpanded property gets destroyed after you close the expander using the expander's button. Have omitted a call to the SetCurrentValue method...?
Example project attached. See the ReadMe.txt for details.
Pretty frustrating that you don't allow attaching archives. Doesn't encourage that much creating example projects. Your ticket system is a pain in the donkey if you are a consultant. Things could be done more easily and efficiently.
Anyways, here's a Google Drive link to download the project: https://drive.google.com/drive/folders/1JvBukVvfmxWsRW5Wb-nRXbT5a6EOWvCd
Let me know when you have downloaded it so I can delete the file.

I want to sort my items via a custom sort order, similar to the implementation detailed here: http://docs.telerik.com/devtools/wpf/controls/radgridview/sorting/custom#custom-sorting-handling-sorting-event
However when I do it seems that e.OldSortingState is always equal to SortingState.None and so I don't get the functionality where first click on column = Ascending, second = Descending, and third = reset to default sorting (ie. None).
The example below should mostly set the sorting to the way it would be if I didn't handle the Sorting event myself. It's only for demonstration. My issue is that I can't ever get to the "else if" and "else" blocks.
private void MainDataGridOnSorting(object sender, GridViewSortingEventArgs e) { RadGridView radGridView = e.Source as RadGridView; if (radGridView == null) { e.Cancel = true; return; } DataView dataView = radGridView.DataContext as DataView; if (dataView == null) { e.Cancel = true; return; } IEnumerable<DataRowView> dataRows = dataView.Cast<DataRowView>(); //If the sorting state is none, sort the items ascending. if (e.OldSortingState == SortingState.None) { e.NewSortingState = SortingState.Ascending; e.Column.SortingState = SortingState.Ascending; dataRows = dataRows .OrderBy(row => row.Field<string>(e.Column.UniqueName)); } //If the sorting state is none, sort the items descending. else if (e.OldSortingState == SortingState.Ascending) { // Cannot reach this block e.NewSortingState = SortingState.Descending; e.Column.SortingState = SortingState.Descending; dataRows = dataRows.OrderByDescending(row => row.Field<string>(e.Column.UniqueName)); } //If the sorting state is descending, apply default sorting to the items. else { // Cannot reach this block e.NewSortingState = SortingState.None; e.Column.SortingState = SortingState.None; dataRows = dataRows.OrderBy(row => row.Field<int>("PrimaryRow")); } radGridView.ItemsSource = dataRows; e.Handled = true; e.Cancel = true; }
Hello,
I'm using a RadDiagram where the users can add images and draw arrows.
By default, when the user draws an arrow over a shape, the arrow connects to the closest connection point. I need to modify this behavior. When the ActiveTool is ConnectorTool and the user clicks on the image, the arrow must start from the point where the user clicked, and not from the closest connection point.
In order to achieve this, I removed all connection points from the image when I add it. This didn't work as expected.
The following code sample allows me te reproduce the error. When I click outside the image, the behavior is nominal.
When I click on the image, an exception is thrown. Instead, I want the application to behave as if the image wasn't there.
In my sample, the ActiveTool is always ConnectorTool, but in my real application, the ActiveTool can have other values. This behavior must only apply to the ConnectorTool. For example, when the PointerTool is active, the user must be able to select and move the image.
class Program{ [STAThread] static void Main(string[] args) { TestWindow win = new TestWindow(); win.ShowDialog(); }}class TestWindow : Window{ public TestWindow() { Grid main_grid = new Grid(); main_grid.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto }); main_grid.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) }); RadDiagram my_diagram = new RadDiagram(); my_diagram.ActiveTool = Telerik.Windows.Diagrams.Core.MouseTool.ConnectorTool; Grid.SetColumn(my_diagram, 1); ViewModel vm = new ViewModel(my_diagram); Button button_add_image = new Button(); button_add_image.Content = "Add image"; button_add_image.Command = vm.CommandAddImage; AddChild(main_grid); main_grid.Children.Add(my_diagram); main_grid.Children.Add(button_add_image); DataContext = vm; }}class ViewModel : ViewModelBase{ public ViewModel(RadDiagram diagram) { MyDiagram = diagram; } public RadDiagram MyDiagram { get; set; } public ICommand CommandAddImage { get { return new ICommandImpl(AddImage); } } public void AddImage() { Microsoft.Win32.OpenFileDialog open_file_dialog = new Microsoft.Win32.OpenFileDialog(); open_file_dialog.Filter = "Image Files (*.png, *.jpg, *.bmp)|*.png;*.jpg;*.bmp"; open_file_dialog.CheckFileExists = true; if (!open_file_dialog.ShowDialog().GetValueOrDefault() || !System.IO.File.Exists(open_file_dialog.FileName)) { return; } System.Windows.Media.Imaging.BitmapImage image_source = new System.Windows.Media.Imaging.BitmapImage(new Uri(open_file_dialog.FileName)); System.Windows.Controls.Image image_displayed = new System.Windows.Controls.Image(); image_displayed.Source = image_source; Viewbox viewbox_added_to_diagram = new Viewbox(); viewbox_added_to_diagram.Stretch = Stretch.Fill; viewbox_added_to_diagram.Margin = new System.Windows.Thickness(-4); viewbox_added_to_diagram.Child = image_displayed; RadDiagramShape shape_added_to_diagram = new RadDiagramShape(); shape_added_to_diagram.Content = viewbox_added_to_diagram; shape_added_to_diagram.Background = Brushes.Transparent; shape_added_to_diagram.BorderBrush = Brushes.Green; shape_added_to_diagram.Connectors.Clear(); MyDiagram.AddShape(shape_added_to_diagram, new Point(20, 20)); } private class ICommandImpl : ICommand { private Action Command; public ICommandImpl(Action p_action) { Command = p_action; } public void Execute(object parameter) { Command(); } public bool CanExecute(object parameter) { return true; } public event EventHandler CanExecuteChanged; }}
I followed the instructions in another post, but I didn't manage to make it work.
I used added the following tool, but the behavior is not what I need. Now, when I click on a shape, nothing happens. I want a new connection to start when I click on a shape.
class CustomConnectionTool : ConnectionTool{ public override bool MouseDown(PointerArgs e) { if (!this.IsActive) return false; var hitItem = this.HitTestService.ItemUnderMouse as IShape; if (hitItem == null || hitItem.Connectors.Count > 0) return base.MouseDown(e); else return false; }}
The post suggested creating a new service or a custom tool, but I couldn't figure it out. In addition, my real application has more styles and custom behavior associated with Connections, so I'd rather not use a different class.
How else can I achieve what I need ? When the user clicks a shape, it must not start from the closest connection, but must instead start from the point where the user clicked.
