Telerik Forums
UI for WPF Forum
4 answers
233 views
To set the scene, I am in an MVVM environment and I am using the Behavior from Vlad's blog post located at
How To: Synchronize your UI selected items with your data context using MVVM and Blend behaviors for Silverlight and WPF

This behavior works great and I have it bound to a ViewModel, I am working on extended this so when the user selects a row, the grid will automatically select any rows that have the same PO Number as the selected row.

View Model Code:
public WarehouseLineItemProxy SelectedLineItem
    {
      get { return selectedLineItem; }
      set
      {
        if (value != null)
        {
          selectedLineItem = value;
          RaisePropertyChanged(() => SelectedLineItem);
 
          //Check for any additional items that have this GP PO Number
          var lineItems = new ObservableCollection<WarehouseLineItemProxy>();
 
          foreach (var lineItem in LineItems.Where(x => x.GPPONumber == selectedLineItem.GPPONumber))
          {
            lineItems.Add(lineItem);
          }
 
          SelectedLineItems = lineItems;
        }
      }
    }

Here, the SelectedLineItem property is bound to the SelectedItem property of the RadGrid, LineItems is an ObservableCollection of business objects that serves as the ItemsSource of the RadGrid.

I then made the following changes in the Behavior:
void GridSelectedItems_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
        {
            UnsubscribeFromEvents();
 
            if (((IList)SelectedItems).Count > Grid.SelectedItems.Count)
            {
              Transfer(SelectedItems as IList, Grid.SelectedItems);
            }
            else
              Transfer(Grid.SelectedItems, SelectedItems as IList);
 
            SubscribeToEvents();
        }

So rather then transferring the Grid's selected items to the SelectedItems dependency property I reverse it and transfer the SelectedItems dependency property into the Grid's selected items.

public static void Transfer(IList source, IList target)
        {
            if (source == null || target == null)
                return;
 
            target.Clear();
 
            foreach (var o in source)
            {
                target.Add(o);
            }
        }


This works and if I look at the Grid.SelectedItems property in a watch it shows me a count of 2.  However the UI only displays one row selected.

Is there a way to force the Grid to re-draw?  Is there a better way to accomplish what I am trying to do?

Any help is greatly appreciated.

Jeremie Grund
Jeremie
Top achievements
Rank 1
 answered on 06 Apr 2011
3 answers
157 views
I am attempting to use this style of  combobox:

http://blogs.telerik.com/vladimirenchev/posts/10-04-09/how_to_filter_as_you_type_radgridview_inside_radcombobox_for_wpf_and_silverlight.aspx

The combobox from this tutorial is then being added to a grid view as a template column.  The combobox seems to work in the regards that it filters as you type and displays the results in a grid format.  However, when you select an item from the results the combobox dropdown stays open and the selection does not appear to have registered (even though the view model does in fact register the selected item).  Also tabbing from the combox box to the next grid column does not work.  Instead it tabs within the results grid.

Basically I want to interact with the combobox as if it were a combox box grid column.  I just want the combobox to display the results as I type in a grid format.

Any suggestions?

Valeri Hristov
Telerik team
 answered on 06 Apr 2011
9 answers
462 views
Hi,

Recently we found one show stopper bug after we moved to telerik controls version 2010.2.812. In this version TrasitionControl seems had serious changes. We use transition control inside datatemplates and rendering of views is done mostly with datatemplates.

Thanks for any help.

Exception - "Cannot resolve all property references in the property path 'Effect.Progress'. Verify that applicable objects support the properties."

StackTrace (stack trace i have copied trying lates internal build 2010.2.1018): 

   at System.Windows.Media.Animation.Storyboard.VerifyPathIsAnimatable(PropertyPath path)
   at System.Windows.Media.Animation.Storyboard.ClockTreeWalkRecursive(Clock currentClock, DependencyObject containingObject, INameScope nameScope, DependencyObject parentObject, String parentObjectName, PropertyPath parentPropertyPath, HandoffBehavior handoffBehavior, HybridDictionary clockMappings, Int64 layer)
   at System.Windows.Media.Animation.Storyboard.ClockTreeWalkRecursive(Clock currentClock, DependencyObject containingObject, INameScope nameScope, DependencyObject parentObject, String parentObjectName, PropertyPath parentPropertyPath, HandoffBehavior handoffBehavior, HybridDictionary clockMappings, Int64 layer)
   at System.Windows.Media.Animation.Storyboard.BeginCommon(DependencyObject containingObject, INameScope nameScope, HandoffBehavior handoffBehavior, Boolean isControllable, Int64 layer)
   at System.Windows.Media.Animation.Storyboard.Begin()
   at Telerik.Windows.Controls.TransitionControl.TransitionPresenter.PlayAnimation() in c:\Builds\WPF_Scrum\HotFix_2010_Q2\Sources\Development\Core\Controls\TransitionControl\TransitionPresenter.cs:line 465
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(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 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.InvokeImpl(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.Threading.Dispatcher.Run()
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at System.Windows.Application.Run()

Yana
Telerik team
 answered on 06 Apr 2011
5 answers
133 views
Hi.

I am to provide a graph that indicate deviation from a set point.

There are five significant points on the Y axis
* Upper scale limit.
* Upper alarm limit
* The desired point (set point).
* Lower alarm limit.
* Lower scale limit.

These can be, for instance
High Scale : 100
High Alarm: 80
Set Point : 50
Low Alarm: 20 
Low Scale: 0.

They can also be,
High Scale : 100
High Alarm: 80
Set Point : 76
Low Alarm: 10 
Low Scale: 0.
 
These two sets of axis settings should draw the exact same Y Axis. Even in the case where the distance from High Alarm to set point is just 4 units and distance from Set Point to Low Alarm is 56 units, they should take equal amount of space of the drawing area. A linear dataset would draw a gently sloping curve from Low Alarm to Set Point, but it would be very steep from Set Point to High Alarm as the whole distance would be covered in just 4 units.

How do I achieve this? I consider using four stacked curves that would each cover one area of the curve on the scale for its area so that it would only APPEAR to be a single curve, but would actually be four different curves. This, however functionally adequate, does not draw a continuous curve. Any better suggestions?
Evgenia
Telerik team
 answered on 06 Apr 2011
1 answer
42 views
I am using Telerik chart control and I want to set the minor ticks on X axis.
I tried this.

radChartROIComparison.DefaultView.ChartArea.AxisX.MinorTicksVisibility = Visibility.Visible;

But compilation fails telling that

Error 1 'Telerik.Windows.Controls.Charting.AxisX' does not contain a definition for 'MinorTicksVisibility' and no extension method 'MinorTicksVisibility' accepting a first argument of type 'Telerik.Windows.Controls.Charting.AxisX' could be found (are you missing a using directive or an assembly reference?) 

What is the reason for this????

Am I using an old version which does not support this property?

Regards
Rangana

 

Giuseppe
Telerik team
 answered on 06 Apr 2011
2 answers
235 views
Hi,

I' ve got the following problem:

In my application there is a window which includes a scheduleview on the left side and a treeview on the right side. The scheduleview itself is inside a user control. In the scheduleview there exist some appointments.
This scenario should work, but currently doesn't:

I select one treeview item and start a drag drop operation. If I am over an appointment in the scheduleview some conditions between the appointment and the treeview item should be checked.
Currently nothing works: I start dragging the treeview item. As soon as I am over the scheduleview, a "forbidden" symbol appears, and nothing more happens.

I've implemented following:

RadDragAndDropManager.SetAllowDrag(treeview,true);
RadDragAndDropManager.AddDragInfoHandler(treeview, new EventHandler<DragDropEventArgs>(OnDrag));
     RadDragAndDropManager.AddDragQueryHandler(treeview,new EventHandler<DragDropQueryEventArgs>(OnDragQuery));
           RadDragAndDropManager.AddDropQueryHandler(scheduleView, new EventHandler<DragDropQueryEventArgs>(OnDropQuery));
           RadDragAndDropManager.AddDropInfoHandler(scheduleView, new EventHandler<DragDropEventArgs>(OnDropInfo));
           RadDragAndDropManager.SetAllowDrop(scheduleView,true);

DragQuery works, but I never reach DropInfo or DropQuery. What am I doing wrong? I have to say, that a treeview item is NOT of type Appointment.

In RadScheduler, the procedure described above worked perfectly.

Please respond soon.
Thanks
hardik
Top achievements
Rank 1
 answered on 06 Apr 2011
1 answer
389 views
Is there an event that I can hook into to be notified when the active pane is changed in the RadDocking control? I have a ribbon that changes based on the active RadDocumentPane.

I found some similar questions in the forum with answers that suggested using the RadPane.GotFocus event. My issue with this is that I also need to properly handle when no RadDocumentPanes are active. I think the ideal solution would involve the RadDocking class having both an ActivePane property and ActivePaneChanged event.

Thanks,
Joey
Konstantina
Telerik team
 answered on 06 Apr 2011
2 answers
178 views
I have a simple candlestick chart:

<telerik:RadChart Name="radChart1" ItemsSource="{Binding ChartData}" Visibility="{Binding CandlestickVisibility}">
    <telerik:ChartDefaultView>
        <telerik:ChartDefaultView.ChartLegend>
            <telerik:ChartLegend IsEnabled="True" Visibility="Collapsed" />
        </telerik:ChartDefaultView.ChartLegend>
    </telerik:ChartDefaultView>
    <telerik:RadChart.SeriesMappings>
            <telerik:SeriesMapping>
            <telerik:SeriesMapping.SeriesDefinition>
                <telerik:CandleStickSeriesDefinition />
            </telerik:SeriesMapping.SeriesDefinition>
            <telerik:SeriesMapping.ItemMappings>
                <telerik:ItemMapping DataPointMember="Open"
                                    FieldName="OpenPrice" />
                <telerik:ItemMapping DataPointMember="High"
                                    FieldName="HighPrice" />
                <telerik:ItemMapping DataPointMember="Low"
                                    FieldName="LowPrice" />
                <telerik:ItemMapping DataPointMember="Close"
                                    FieldName="ClosePrice" />
            </telerik:SeriesMapping.ItemMappings>
        </telerik:SeriesMapping>
    </telerik:RadChart.SeriesMappings>
</telerik:RadChart>

When I go into the designer and click the IsDateTime for the X Axis, I get a Microsoft .NET Framework exception: "Specified cast is not valid" with this callstack System.Windows.Markup.XamlParseException: Specified cast is not valid. ---> System.InvalidCastException: Specified cast is not valid.
   at MS.Internal.Designer.PropertyEditing.Resources.ResourceUtilities.GetDouble(FrameworkElement element, String key, Double fallbackValue)
   at MS.Internal.Designer.PropertyEditing.Resources.ResourceUtilities.GetDesiredTypeIconSize(FrameworkElement queryRoot)
   at MS.Internal.Designer.PropertyEditing.Editors.SubPropertyEditor.RefreshQuickTypes()
   at MS.Internal.Designer.PropertyEditing.Editors.SubPropertyEditor.RefreshVisuals()
   at MS.Internal.Designer.PropertyEditing.Editors.SubPropertyEditor.OnPropertyEntryChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at MS.Internal.Designer.PropertyEditing.Editors.SubPropertyEditor.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.StyleHelper.ApplyTemplatedParentValue(DependencyObject container, FrameworkObject child, Int32 childIndex, FrugalStructList`1& childRecordFromChildIndex, DependencyProperty dp, FrameworkElementFactory templateRoot)
   at System.Windows.StyleHelper.InvalidatePropertiesOnTemplateNode(DependencyObject container, FrameworkObject child, Int32 childIndex, FrugalStructList`1& childRecordFromChildIndex, Boolean isDetach, FrameworkElementFactory templateRoot)
   at System.Windows.FrameworkTemplate.InvalidatePropertiesOnTemplate(DependencyObject container, Object currentObject)
   at System.Windows.FrameworkTemplate.HandleBeforeProperties(Object createdObject, DependencyObject& rootObject, DependencyObject container, FrameworkElement feContainer, INameScope nameScope)
   at System.Windows.FrameworkTemplate.<>c__DisplayClass6.<LoadOptimizedTemplateContent>b__3(Object sender, XamlObjectEventArgs args)
   at System.Xaml.XamlObjectWriter.OnBeforeProperties(Object value)
   at System.Xaml.XamlObjectWriter.Logic_CreateAndAssignToParentStart(ObjectWriterContext ctx)
   at System.Xaml.XamlObjectWriter.WriteStartMember(XamlMember property)
   at System.Xaml.XamlWriter.WriteNode(XamlReader reader)
   at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlReader templateReader, XamlObjectWriter currentWriter)
   --- End of inner exception stack trace ---
   at System.Windows.Markup.XamlReader.RewrapException(Exception e, Uri baseUri)
   at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlReader templateReader, XamlObjectWriter currentWriter)
   at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlObjectWriter objectWriter)
   at System.Windows.FrameworkTemplate.LoadOptimizedTemplateContent(DependencyObject container, IComponentConnector componentConnector, IStyleConnector styleConnector, List`1 affectedChildren, UncommonField`1 templatedNonFeChildrenField)
   at System.Windows.FrameworkTemplate.LoadContent(DependencyObject container, List`1 affectedChildren)
   at System.Windows.StyleHelper.ApplyTemplateContent(UncommonField`1 dataField, DependencyObject container, FrameworkElementFactory templateRoot, Int32 lastChildIndex, HybridDictionary childIndexFromChildID, FrameworkTemplate frameworkTemplate)
   at System.Windows.FrameworkTemplate.ApplyTemplateContent(UncommonField`1 templateDataField, FrameworkElement container)
   at System.Windows.FrameworkElement.ApplyTemplate()
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.StackPanel.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.ContextLayoutManager.UpdateLayout()
   at System.Windows.UIElement.UpdateLayout()
   at System.Windows.Interop.HwndSource.SetLayoutSize()
   at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
   at System.Windows.Interop.HwndSource.set_RootVisual(Visual value)
   at System.Windows.Forms.Integration.ElementHost.OnHandleCreated(EventArgs e)
   at System.Windows.Forms.Control.WmCreate(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.Integration.ElementHost.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
How do I make the X Axis a datetime without blowing out the designer?
Nikolay
Telerik team
 answered on 06 Apr 2011
1 answer
110 views
Hi Everyone, 

I am looking for a kml example to go off of.  When I follow the documentation i get nothing.  Does anyone have anything. 

Thanks, 

-zd
Andrey
Telerik team
 answered on 06 Apr 2011
8 answers
197 views
We are building an application that uses the MVVM pattern and Prism.
Our application utilizes Rad Docking Serialization.
The application has a DocumentHost with several tabbed Panes.  When a new Pane is added to the application inside the DocumentHost, it's not initially displayed after the docking serialization is read in.  But we hook a toggle button up to each pane to control visibility and clicking the button brings the new pane into view.
Here's the problem.
When we add a new Pane outside of the DocumentHost, the trick above doesn't work.  The pane will not be seen unless the serialization is deleted.

I found mention of using LayoutSerializationLoadingEventArgs but could not find an example.
Is there an event I can catch to add the new pane to the serialization?
Or should this just work, and there's something wrong with my implementation?
Thanks
George
Telerik team
 answered on 06 Apr 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?