Telerik Forums
UI for WPF Forum
1 answer
123 views
The following xaml give me an error (Could not load file or assembly 'Telerik.Windows.PersistenceFramework...) during runtime:
<UserControl x:Class="MainSail.EquipmentList.Views.EquipmentListNavigator"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:l="clr-namespace:MainSail.Common;assembly=MainSail.Common"
             xmlns:local="clr-namespace:MainSail.EquipmentList.Views"
             mc:Ignorable="d"
             FontSize="14"
             Height="500">
  <telerik:RadDockPanel>
    <Border Margin="10,5,10,10" Grid.Row="1" CornerRadius="4,4,4,4" BorderBrush="#193441" Background="#DDDCC5" BorderThickness="2,2,2,2">
      <!-- EQUIPMENT TREE -->
    <telerik:RadTreeListView Name="equipmentTreeView" Margin="8" Background="Beige"
                         telerik:PersistenceManager.StorageId="equipmentTreeView"
                         ItemsSource="{Binding FirstGeneration}"
                         telerik:StyleManager.Theme="Vista" 
                         IsDragDropEnabled="True"
                         SelectionMode="Single"
                         SelectionUnit="FullRow"
                         IsSynchronizedWithCurrentItem="False"
                         AutoGenerateColumns="False" >

Rob
Top achievements
Rank 1
 answered on 29 Oct 2012
0 answers
34 views

I am trying to write a C# program in wpf that retrieves the content of a web page.

The first thing I tried was to try the WebRequest and WebResponse classes.  This did not provide the actual displayed content.  WebResponse reveils the HTML code that is sent to the browser.  But I discovered that, while the page is being loaded by the browser, javascript can change what content is finally displayed in the browser.

So I decided to use the WebBrowser class.

Immediately I found that there are two WebBrowser classes.  Thee is the one that is documented for WinForms and there is another that is documented for WPF.  I need to understand the one documented for WPF.  What I think I neeed to know what to do is to retrieve code after the "LoadCompleted" method is caused.  But I do not know how to this and I cannot find any example demonstrating how this is done.

 

William
Top achievements
Rank 1
 asked on 28 Oct 2012
1 answer
69 views
Not sure what info to write, but wanted to get this thread started. I have a project with 2 UI developers. I run some of the testing and builds on my machine.

The UI guys can pull data for some grids and it displays just fine. No issues. I will get latest, compile and run the app. I see the data everywhere except for 3 particular grids. All grids are coded up the same way-same design pattern. Also, we use mvvm style.

The UI developers compiled and ran on 5 different machines (VMs, physcials win7 and win8) The data in the grid always appears.

I am running win7 on a VM. I have the same version of telerik controls installed.

any ideas?

thanks

version: 2012.2.725.40
Robert
Top achievements
Rank 1
 answered on 27 Oct 2012
2 answers
301 views
Hi,

I'm version 2012.3.1017.40 and trying to enabled the TrackBar Behavior on a double-click on the chart's data area and then disable it with another double click.  I keep getting an exception when I try to disable it.  I'm wondering if this is a bug with the control, or is it the way I'm trying to disable it?

Here is how I'm trying to Enable/Disable the TrackBall behavior:
 
private void radCartesianChart1_MouseDoubleClick(object sender, MouseButtonEventArgs e)
    {      
  
      int index = -1;
  
      for (int i = 0; i < radCartesianChart1.Behaviors.Count; i++)
      {
        if (radCartesianChart1.Behaviors[i] is ChartTrackBallBehavior)
        {
          index = i;
          break;
        }
      }
  
      var mousePosition = e.GetPosition(this);
      Telerik.Charting.DataTuple tuple = radCartesianChart1.ConvertPointToData(mousePosition);
  
      //make sure the double-click occurred in the chart data area
      if (Convert.ToSingle(tuple.FirstlValue) > 0 && Convert.ToSingle(tuple.SecondValue) > 0)
      {
        if (_ShowTrackBall == false)
        {
          //create the TrackBallBehavior and add
          if (index == -1)
          {
            ChartTrackBallBehavior tb = new ChartTrackBallBehavior();
            tb.ShowIntersectionPoints = true;
            tb.ShowTrackInfo = true;
            radCartesianChart1.Behaviors.Add(tb);
  
            _ShowTrackBall = true;
          }
        }
        else
        {
          if (index != -1)
          {
            ChartTrackBallBehavior tb = radCartesianChart1.Behaviors[index] as ChartTrackBallBehavior;
            radCartesianChart1.Behaviors.Remove(tb);
  
            _ShowTrackBall = false;
          }
        
      }  
    }

It throws an System.ArgumentNullException, {"Value cannot be null.\r\nParameter name: key"},  when I try to disable it with the following StackTrace:
   at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
   at System.Collections.Generic.Dictionary`2.ContainsKey(TKey key)
   at Telerik.Windows.Controls.ChartView.ChartTrackBallBehavior.GetPresenterToDataPointInfos(List`1 dataPointInfos) in c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\Behaviors\ChartTrackBallBehavior.Branch.cs:line 697
   at Telerik.Windows.Controls.ChartView.ChartTrackBallBehavior.FilterDataPointsByClosestCategoryPerAxis(List`1 dataPointInfos) in c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\Behaviors\ChartTrackBallBehavior.Branch.cs:line 674
   at Telerik.Windows.Controls.ChartView.ChartTrackBallBehavior.UpdateDataContext(ChartDataContext context) in c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\Behaviors\ChartTrackBallBehavior.Branch.cs:line 371
   at Telerik.Windows.Controls.ChartView.ChartTrackBallBehavior.UpdateVisuals() in c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\Behaviors\ChartTrackBallBehavior.Branch.cs:line 345
   at Telerik.Windows.Controls.ChartView.ChartTrackBallBehavior.OnMouseMove() in c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\Behaviors\ChartTrackBallBehavior.Branch.cs:line 570
   at Telerik.Windows.Controls.ChartView.ChartTrackBallBehavior.AdornerContainerMouseMove(Object sender, MouseEventArgs e) in c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\Behaviors\ChartTrackBallBehavior.Branch.cs:line 588
   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.MouseDevice.Synchronize()
   at System.Windows.Input.MouseDevice.ChangeMouseCapture(IInputElement mouseCapture, IMouseInputProvider providerCapture, CaptureMode captureMode, Int32 timestamp)
   at System.Windows.Input.MouseDevice.Capture(IInputElement element, CaptureMode captureMode)
   at System.Windows.UIElement.CaptureMouse()
   at Telerik.Windows.Controls.ChartView.ChartPanAndZoomBehavior.AdornerContainerMouseLeftButtonDown(Object sender, MouseButtonEventArgs e) in c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\Behaviors\ChartPanAndZoomBehavior.Branch.cs:line 256
   at System.Windows.Input.MouseButtonEventArgs.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.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.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 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.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at System.Windows.Application.Run()
   at delete_TelerikGridViewTest.App.Main() in C:\Users\dkepple\documents\visual studio 2010\Projects\delete_TelerikGridViewTest\delete_TelerikGridViewTest\obj\x86\Debug\App.g.cs:line 0
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(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.Threading.ThreadHelper.ThreadStart()

dd

Thanks,
David
David
Top achievements
Rank 1
 answered on 26 Oct 2012
1 answer
113 views
Please find the sample project here

The sample application is divided into two parts:

The bottom part is similar to the RadListBox drag-n-drop demo with 4 elements:
  1. RadListBox bound to ObservableCollection<Country> CountryList
  2. RadListBox bound to ObservableCollection<Country> GroupA
  3. RadListBox bound to ObservableCollection<City> GroupD
  4. WPF ListBox bound to ObservableCollection<Country> GroupA, AllowDrop unset

The Drag-n-Drop behaviour is as expected, I can drag n drop between 1&2, but not to 3 or 4, it worked very well.

The top part is the identical setup, except it is contained within a RadTileView, and there are a few unexpected behaviours:

  1. Cursor no longer change to Cursors.No when drag over list 3 & 4
  2. When dropped on list 3, nothing happens, this is good. But when dropped on list 4 or anywhere on the tileview that's not a RadListBox, the item is removed from the drag source, and not added to anywhere.

So how do I fix these two issues?
Zarko
Telerik team
 answered on 26 Oct 2012
1 answer
79 views
Hi All,

I want create the RadGridView Control with Editable Rows. Once i Edit the GridView's last row then pressing enter should add the new row and focus should be in the First column. Can you guide me on this? Also if there is any sample please share with me...

Thansk and Regards,
Sakthi 
Dimitrina
Telerik team
 answered on 26 Oct 2012
1 answer
150 views
Hi,

How can I create shapes and connection objects not in the UI thread?
*diagram.Items.Add will be done in the UI thread...

Kind regards,
Igor
Zarko
Telerik team
 answered on 26 Oct 2012
3 answers
90 views
Hi,

I am using a class as per your Helpfile.when i use this systax as <local:CustomDragDropBehavior />    .It shows me error  as "Type not found.Verify that you are missing an assemble refernce".How to fix this Problem?

<Page x:Class="Page1"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
            xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
            mc:Ignorable="d"
            d:DesignHeight="300" d:DesignWidth="300"
            Title="Page1">
        <Grid>
        <telerik:RadGanttView x:Name="radchart" TasksSource="{Binding Tasks}" >
<telerik:RadGanttView.DragDropBehavior>
        <local:CustomDragDropBehavior />   
    </telerik:RadGanttView.DragDropBehavior>
            <telerik:RadGanttView.Columns>
                <telerik:ColumnDefinition MemberBinding="{Binding Start}" Header="Start" ColumnWidth="140">
                    <telerik:ColumnDefinition.CellEditTemplate>
                        <DataTemplate>
                            <!--<telerik:RadDateTimePicker SelectedValue="{Binding Start,Mode=TwoWay}" />-->
                        </DataTemplate>
                    </telerik:ColumnDefinition.CellEditTemplate>
                </telerik:ColumnDefinition>
                <telerik:ColumnDefinition MemberBinding="{Binding End}" Header="End" ColumnWidth="140">
                    <telerik:ColumnDefinition.CellEditTemplate>
                        <DataTemplate>
                            <!--<telerik:RadDateTimePicker SelectedValue="{Binding End,Mode=TwoWay}" />-->
                        </DataTemplate>
                    </telerik:ColumnDefinition.CellEditTemplate>
                </telerik:ColumnDefinition>
                <telerik:ColumnDefinition MemberBinding="{Binding Progress}" Header="Progress" ColumnWidth="100">
                    <telerik:ColumnDefinition.CellEditTemplate>
                        <DataTemplate>
                            <!--<telerik:RadNumericUpDown Value="{Binding Progress, Mode=TwoWay}" CustomUnit="%" Minimum="0"
                        Maximum="100" />-->
                        </DataTemplate>
                    </telerik:ColumnDefinition.CellEditTemplate>
                </telerik:ColumnDefinition>
            </telerik:RadGanttView.Columns>
        </telerik:RadGanttView>
    </Grid>
</Page>
Yana
Telerik team
 answered on 26 Oct 2012
4 answers
157 views
I am trying to draw some polygons and within the polygons I want to put information about the polygon.  

Eventually I will have multiple textblocks in the stackpanel.  I don't understand how to bind to my additional data.  I am using MVVM and my polygon binds good to Points. 

If I change the textblock to 
<TextBlock Text="Test" /> the textblock will show in the polygon with Test.  Output does not show any binding issues, it just doesn't work.  

<
telerik:RadMap x:Name="radMap" Center="49.002049,-101.367682" ZoomLevel="8" Width="1350" Height="700">
<telerik:InformationLayer x:Name="infoLayer" ItemsSource="{Binding Model.Items}">
    <telerik:InformationLayer.ItemTemplate>
        <DataTemplate>
        <telerik:MapPolygon Points="{Binding Points}" Fill="Green" >
        <telerik:MapPolygon.CaptionTemplate  >
            <DataTemplate>
                <StackPanel Background="Yellow" >
                        <TextBlock Text="{Binding SubItem}" />
                </StackPanel>
            </DataTemplate>
        </telerik:MapPolygon.CaptionTemplate>
        </telerik:MapPolygon>
        </DataTemplate>
    </telerik:InformationLayer.ItemTemplate>
</telerik:InformationLayer>
</telerik:RadMap>



Andrey
Telerik team
 answered on 26 Oct 2012
3 answers
101 views
Hi everyone,
I'm desperately trying to show a tooltip on a SplineSeriesDefinition, but it doesn't work. I've read the most of the related post but unluckily, I wasn't able to fix my problem. I have a DataSeries populated with several DataPoint. I tried to set the tooltip on every DataPoint, on the SplineSeriesDefinition and even on the SeriesMapping unsuccessfully. All that I want is a tooltip when mouse is over the curve. Please, I urgently need to fix this problem. Might someone help me, please?
Below there's the definition of the RadChart in my XAML code, and a piece of code of my CS file:

<telerik:RadChart Name="radChartCurva" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Left" Grid.Row="0" />

foreach (DatosGrafica graf in media)
                        {
                            DataPoint dp = new DataPoint(graf.valorX, graf.ValorPunto);
                            dp.Tooltip = graf.ValorPunto.ToString();
                            seriesCurva.Add(dp);
                            seriesMedia.Add(new DataPoint(graf.valorX, graf.Media));
                        }
                        seriesCurva.LegendLabel = StringResources.curve;
                        seriesMedia.LegendLabel = StringResources.average;
                        
                        SplineSeriesDefinition serieDef = new SplineSeriesDefinition();
                        SplineSeriesDefinition serieDef2 = new SplineSeriesDefinition();
                        serieDef.ShowItemLabels = false;
                        serieDef.ShowPointMarks = false;
                        serieDef.ShowItemToolTips = true;
                        serieDef2.ShowItemLabels = false;
                        serieDef2.ShowPointMarks = false;
                        serieDef2.ShowItemToolTips = true;


                        seriesCurva.Definition = serieDef;
                        seriesMedia.Definition = serieDef2;


                        SeriesMapping sm = new SeriesMapping();
                        sm.SeriesDefinition = serieDef;
                        sm.ItemMappings.Add(new ItemMapping("XValue",DataPointMember.XValue));
                        sm.ItemMappings.Add(new ItemMapping("YValue", DataPointMember.YValue));
                        this.radChartCurva.SeriesMappings.Add(sm);
                        this.radChartCurva.DefaultView.ChartArea.DataSeries.Add(seriesMedia);
                        this.radChartCurva.DefaultView.ChartArea.DataSeries.Add(seriesCurva);

What's wrong with my code?

Thanks in advance guys :-)
Davide
Top achievements
Rank 1
 answered on 26 Oct 2012
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?