Telerik Forums
UI for WPF Forum
5 answers
176 views
Consider my ConnectionManipulationCompleted event handler:

private void diagram_ConnectionManipulationCompleted(object sender, ManipulationRoutedEventArgs e)
{
    if (e.ManipulationStatus == ManipulationStatus.Attaching)
    {
        var source = e.Connection.Source as MyChartShape;
        ...
    }
}

In some cases e.Connection.Source is null. E.g.
1) From a node's connector, drag a new connection.
2) Detach the connection so you end up with a floating one.
3a) Re-attach the tail of the connection to the node's connector. Source is null, target is valid!
3b) Re-attach the head of the connection to the node's connector. Source is null, target is valid!


In 3a the target is in fact the source. In 3b the target is indeed the target. How can I distinguish these two scenarios?
Obviously, in 3a I want a way to see that the target is the source so that I can successfully update our underlying data where the direction of the connection is critical!
Tina Stancheva
Telerik team
 answered on 15 Apr 2013
13 answers
212 views
Seems like a bug. Now I have to re-assign the GraphSource instance in order to see changes in the view. Adding/removing items has no effect.
Tina Stancheva
Telerik team
 answered on 15 Apr 2013
9 answers
95 views
Hi,

How would you modify this program so that when dragging it shows the contents of the ID or UserName column.  Ideally this might be done when calling RowOrderBehaviorSetIsEnable(Grid1, true).  This would allow the code to handle more than 1 data format.

Thanks
Rich
Richard Harrigan
Top achievements
Rank 1
 answered on 15 Apr 2013
1 answer
248 views
Hello, 
I'm running into a problem involving focus not being lost on an editable RadComboBox (in a property grid) when I click on a RadRibbonButton (in a RadRibbonGroup).  If I type some text into the combo box text area, it is not stored to the dependency property that it is bound to until the control loses focus.

<telerik:RadComboBox
   IsMouseWheelEnabled="False"
   ItemContainerStyle="{StaticResource ComboBoxItemStyle}"
   IsEditable="True"
   Text="{Binding Value, Mode=TwoWay, UpdateSourceTrigger=LostFocus}">
   <telerik:RadComboBox.ItemsSource>
      <Binding Converter="{StaticResource AssetToListConverter}">
         <Binding.Path>Value</Binding.Path>
      </Binding>
   </telerik:RadComboBox.ItemsSource>
</telerik:RadComboBox>

This is required because the Value property is coerced to a valid string before being accepted, and without UpdateSourceTrigger=LostFocus the text box fails to take on the coerced value, something broken in the binding there.

public Object Value
{
   get
   {
      return _property.GetValue(_asset, null);   //using reflection
   }
   set
   {
      //SetValue ends up calling a coerce function which leaves the property untouched if value is invalid
      _property.SetValue(_asset, value, null);
      RaisePropertyChanged(() => Value);
   }
}

If UpdateSourceTrigger was set to PropertyChanged, this setter would be called every time the user types any characters.  If they type an invalid character the coerce function leaves the property unchanged but the text box displays the incorrect string, even though Value is different.

If the user starts typing something into the combo box and then clicks the button (which does a save or export), the Value is not set because the combo box does not lose focus.

<telerik:RadRibbonGroup x:Name="root" Header="Destructible" DialogLauncherVisibility="Collapsed">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <telerik:RadRibbonButton Grid.Row="0"
                                     Grid.Column="0"
                                     Text="New"
                                     IsAutoSize="True"
                                     Command="{Binding NewCommand}" />
        <telerik:RadRibbonButton Grid.Row="1"
                                     Grid.Column="0"
                                     Text="Save"
                                     IsAutoSize="True"
                                     Command="{Binding SaveCommand}" />
        <telerik:RadRibbonButton Grid.Row="2"
                                     Grid.Column="0"
                                     Text="Export"
                                     IsAutoSize="True"
                                     Command="{Binding ExportCommand}" />
    </Grid>
</telerik:RadRibbonGroup>

These two controls are in different assemblies.  I tried clearing focus for the scope in the button command code-behind but at that time Keyboard.FocusedElement is the button.  I can't find any way to force all focus scopes to clear their FocusedElement fields either.  I tried playing with the button's IsTabStop property.  I tried hooking up to a focus changed event on the button (can't find one that gives me the previously focused element, and it probably wouldn't be what I want thanks to focus scopes).  

I might be able to cache off the element every time something changes focus in the property grid and clear its focus scope on button clicks, but this doesn't seem very scaleable.

So I need to fix one of two problems.  Either figure out how to clear focus on the combo box when the button is clicked but before the command is executed, or figure out how to fix the binding issue of the text in the combo box.  Do you have any advice on either fronts?

TIA, Jay
Zarko
Telerik team
 answered on 15 Apr 2013
1 answer
132 views

Requirement:
Set the font, the foreground and background color of the grid (headerrow and and "datarow) at runtime over a context menu. Save it and reload theses on restart.

Actual situation:
- We have implemented a contextmenu for the grid with an attached property. On attaching it "taps" the grid and it is possible to enable and disable single columns over this context menu which opens on right mouse click on header.
- Additional to that, we implemented an additional attached property which also "taps" to the grid OnAttaching, which allows to save the grid settings (columns width, enable columns, filter...) to a file. Add restart the grid takes this settings add set the saved values.
- The grid is styles are in different resource dictionaries which will be added to Application.Current.Resources.MergedDictionaries

Problem:
Now, I would like to add some additional context menu (this works) with color pickers and a font picker (does telerik have a font picker in future for wpf?).
If an new color is selected I created a new style (in code behind) an added it to the resources of the grid. This runs, but now I can't find a solution to save this style like the over values. 

How can I save this lokal style? Is this solution wrong? Do you have an better simpler solution?

Thanks & Regards

 

Dimitrina
Telerik team
 answered on 15 Apr 2013
1 answer
63 views
Hi,

I had installed the free trial of the demos for RadControls and started getting the "Enjoying your RadContolrs for WPF trial?" message when running the installed version of my app but not so when running the app from VS.
I have now installed the purchased version of the WPF IU Controls, after uninstalling the free trial, and I’m still getting the message when running the installed version of my app.
Missing User
 answered on 15 Apr 2013
1 answer
80 views
Run your own samples. They crash too.

Drag a connection from connector A to connector B. Then detach it from B and press Escape to undo the detach operation. This throws an exception. Sigh...

When you fix this, please make sure that the operation is indeed undoable in that sense a new Attaching event is fired.
Pavel R. Pavlov
Telerik team
 answered on 15 Apr 2013
3 answers
93 views
Running latest build (RadControls_for_WPF_2013_1_0401_DEV_hotfix). See attached images!

When I connect two filters where the target has more connectors than the source, the nodes are erroneously arranged (in the attached image you can see that they are effectively swapped). Why does this occur? Please help!

Edit: Also, note the exception (green node). There, the target has indeed more connectors, but the source has none from above.
Petar Mladenov
Telerik team
 answered on 15 Apr 2013
1 answer
84 views
I manage to place my diagram on the edge of the view when zooming in and out a couple of times, moving the mouse at the same time (obviously changing the center point). I want my diagram nodes to never touch the edge of the view. How can I achieve this?

Please note that setting the diagram's Margin does not help.
Hristo
Telerik team
 answered on 15 Apr 2013
2 answers
219 views
Hi,
    I am creating application in that we have multiple series representing different data source just like line,bar,etc.Now what i want to accomplish is that i want to change the data template of bar series so that each rectangle will have of different color.I found this in Online documentation but it is accomplished in XAML. I did not find any resource of changing the template using C# code.Could you please help me to accomplish this?
Thanks in advance.
Dts
Top achievements
Rank 1
 answered on 15 Apr 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?