| <Controls:RadGridView.InputBindings> |
| <MouseBinding Gesture="LeftDoubleClick" Command="{Binding RecipeSelectedCommand}"/> |
| </Controls:RadGridView.InputBindings> |
I was previously using the Telerik EventToCommandBehavior to capture the double-click event for my GridView, but as others have discovered I had the issue that it also triggered when a user clicked on the scrollbar quickly:
<telerik:EventToCommandBehavior.EventBindings> <telerik:EventBinding EventName="MouseDoubleClick" Command="{Binding ShowEditWindowCmd}" CommandParameter="{Binding SelectedItem, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadGridView}}}" /></telerik:EventToCommandBehavior.EventBindings>
So now I've switched over to another solution using the code-behind, but it feels like it breaks the MVVM model too much in my case. I realize I'm splitting hairs because this does what I want, but is there maybe a better (cleaner) way to do this? I would love to use the EventToCommandBehavior on the row, but couldn't figure out how.
public partial class PackageBoardsGrid : UserControl{ PackageBoardsPage pageVM; public PackageBoardsGrid() { InitializeComponent(); this.DataContextChanged += ( o, e ) => { if( e.NewValue is PackageBoardsPage ) pageVM = (PackageBoardsPage)e.NewValue; }; } private void Grid_RowLoaded( object sender, Telerik.Windows.Controls.GridView.RowLoadedEventArgs e ) { if( e.Row is GridViewRow ) { e.Row.AddHandler(GridViewRow.MouseDoubleClickEvent, new MouseButtonEventHandler(OnRowMouseDoubleClick), true); } } private void OnRowMouseDoubleClick( object sender, MouseButtonEventArgs args ) { if( pageVM != null ) { var gridViewRow = sender as GridViewRow; if( gridViewRow != null ) { var data = gridViewRow.DataContext as LiveBoard; if( data != null ) pageVM.ShowEditWindowCmd.Execute(data); } } }}
Hi,
I want to restrict which shapes can be connected. In my application there are rules of which shapes may be connected. What I want is that if a user tries to connect two shapes, that cannot be connected (incompatible?) it will reject the connection or display an error on the connection.
Can I do this?
Thx
Rob
Hello, please i need your help,
I have a RadGridView and the rows have different types, for example: Type A, Type B, .... and sometimes there is a relation between rows, and if a user try to delete a row (for example row A) I check if there is a relation between the row that the user want to delete (row A) and all the rows of the RadGridView, and if there is a relation I propose to the user if he want to delete the row (Row B for example) (or rows) who the row A have a relation.
I used the event RowsChanging to get the index of the rows that the user wants to delete, like this, and then I can delete the rows who have a relation with the row A.
private void radGridView_RowsChanging(object sender, GridViewCollectionChangingEventArgs e)
{
if (e.Action == NotifyCollectionChangedAction.Remove) // The Action is to delet the row A
{
// if(I check if row A have a relation with another row)
{
//i delet this rows
radGridView .Rows.RemoveAt(indexoftherowiwanttodelet);
}
}
}
My problem is:
If the index of the row A is smaller than the index of the row B, the code works very well.
But if the index of the row A is bigger than the row B, I have an exception:
'System. ArgumentOutOfRangeException' occurred in mscorlib.dll
I need your help and thank you.


Hi,
I want to save selections like shape border thickness as settings so when the user work with the tool again the last selected thickness should be selected instead of the default value.
How do I approach and solve this?
Best regards
Hi,
is it possible to save the image editor settings I used last? I would like to have the same StrokeColor, Shape and StrokeThickness again if I open another picture with the imageeditor.
Best regards.

When I programatically add a radpane to docking. It is coming out only as tall as the header of a pane. (Picture attached of result.)
I have tried a few methods.
Here is what I am trying:
RadPane dockPaneCalc = new RadPane() { IsHidden = false, Content = new RadCalculator() { VerticalAlignment = VerticalAlignment.Stretch, HorizontalAlignment = HorizontalAlignment.Stretch } }; RadPaneGroup paneGroup = new RadPaneGroup(); RadSplitContainer splitContainer = new RadSplitContainer() { InitialPosition = Telerik.Windows.Controls.Docking.DockState.FloatingOnly, Height = 350, Width = 250 }; RadDocking.SetFloatingLocation(splitContainer, new Point(200, 200)); RadDocking.SetFloatingSize(splitContainer, new Size(250, 350)); paneGroup.Items.Add(dockPaneCalc); splitContainer.Items.Add(paneGroup); dockMain.Items.Add(splitContainer);The InlineUiContainer is allowed to be inserted into RadRichTextBox officially by Telerik.
But there're some problems:
When I insert a <Textbox> in to RadRichTextBox
<telerik:InlineUIContainer>
<TextBox Width="100" Height="50"/>
</telerik:InlineUIContainer>
The TextBox can be shown in the RadRichTextBox correctly, and input charactors in inner TextBox correctly. But when I press "Backspace", the cursor will jump to to outer RadRichTextBox instead of delete the last character in inner TextBox !
I used to think it's caused by the Microsoft WPF and Telerik WPF these 2 mechanisms (incompatible).Then I tried to use a RadTextBox, but no this control (with the acceptable reason: no color can be set on this control, so theme is unnecessary).
Fortunately, I found a Telerik control called telerik:RadMaskedTextInput, then I tried it as
<telerik:InlineUIContainer>
<telerik:RadMaskedTextInput Width="100" Height="50" TextMode="PlainText"/>
</telerik:InlineUIContainer>
But the problem is still !!!! Press "backspace" in the inner RadMaskedTextInput will make the cursor jump into the outer RadRichTextBox .............
On the other hand, if you insert a RadRichTextB​ox into a RadRichTextBox , the cursor is Okay both in inner and outer RadRichTextBox .
I'm using ver 2014Q3.
Then Whether this problem has been fixed now ? If yes , could you please tell me the ver?
