Telerik Forums
UI for WPF Forum
5 answers
304 views
Hi,

I have a problem with the "Export to image"  feature of the RadDiagram.
In particular when I export an image with lots of RadDiagramShape and RadDiagramConnections the image has a  correct dimension, but the shapes and the connections are blurred. 

The following is the piece of code which I use to  serialize the image and I' ve attached  an example of exported image.

using (var rawImageStream = new MemoryStream())            {
                diagram.ExportToImage(rawImageStream, margin: ExportMargin, backgroundBrush: new SolidColorBrush(Colors.White));
                rawImageStream.Seek(0, SeekOrigin.Begin);

                using (var trimmedBitmap = new Bitmap(rawImageStream).Trim(0xffffff)) {
                    trimmedBitmap.Save(outputStream, ImageFormat.Png);
                }
  }


Is there a way to improve it and render the exported image clearer?
Thanks

Ciro
Aakansha
Top achievements
Rank 1
 answered on 27 Sep 2014
3 answers
109 views
Is there an example available that demonstrates the usage of the ModalEditor class for the property grid?    

I'd like to specify my own editor template for a particular field using the DataTemplateSelector.   The editor would display a modal window.

Thanks.

Ben Brouse
Yoan
Telerik team
 answered on 26 Sep 2014
3 answers
385 views
Im getting the following exception when i try to create a QRCode and render it as an image in c#.

System.ArgumentOutOfRangeException was unhandled
  _HResult=-2146233086
  _message=The parameter value must be greater than zero.
  HResult=-2146233086
  IsTransient=false
  Message=The parameter value must be greater than zero.
Parameter name: pixelWidth
  Source=PresentationCore
  ParamName=pixelWidth
  StackTrace:
       at System.Windows.Media.Imaging.RenderTargetBitmap..ctor(Int32 pixelWidth, Int32 pixelHeight, Double dpiX, Double dpiY, PixelFormat pixelFormat)
       at Telerik.Windows.Media.Imaging.ExportHelper.GetBitmapSource(FrameworkElement element, Double dpiX, Double dpiY)
       at Telerik.Windows.Media.Imaging.ExportHelper.GetElementImage(FrameworkElement element)
       at Telerik.Windows.Media.Imaging.ImageExporter.Export(FrameworkElement element, Stream stream, BitmapEncoder encoder)
       at Telerik.Windows.Media.Imaging.ExportExtensions.ExportToImage(FrameworkElement element, Stream stream, BitmapEncoder encoder)
       at TelerikWpfApp1.MainWindow.Button_Click(Object sender, RoutedEventArgs e) in c:\Users\Martin\Documents\Visual Studio 2013\Projects\TelerikWpfApp1\TelerikWpfApp1\MainWindow.xaml.cs:line 46
       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.RaiseEvent(RoutedEventArgs e)
       at System.Windows.Controls.Primitives.ButtonBase.OnClick()
       at System.Windows.Controls.Button.OnClick()
       at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
       at System.Windows.UIElement.OnMouseLeftButtonUpThunk(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.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
       at System.Windows.UIElement.OnMouseUpThunk(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.LegacyInvokeImpl(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()
       at TelerikWpfApp1.App.Main() in c:\Users\Martin\Documents\Visual Studio 2013\Projects\TelerikWpfApp1\TelerikWpfApp1\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.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()

Im using 2014.2.729.40. Attached is a new Telerik Wpf app project that shows the same behaviour as my program.

TelerikWpfApp1.zip

Am I missing some vital property or is this a known issue?

Thanks,
MArtin
Tsvetie
Telerik team
 answered on 26 Sep 2014
6 answers
125 views
is it possible to show Two different SeriesItemLabel in RangeBarSeriesDefinition for High/Low value?

Martin Ivanov
Telerik team
 answered on 26 Sep 2014
3 answers
586 views
I have a muliple hierarchy Gridview with a context menu and I would like to pass the current row from the grid when clicking a particular item from grid, however when I do check check for the method handler in the VM, the parameter is always null.
What I would like to do is get access to the Row datacontext in the grid when a user clicks on the menu.
XAML code:
<telerik:RadGridView RowIndicatorVisibility="Hidden" SelectionMode="Single" SelectionUnit="FullRow" SelectedCellsChanged="RadGridView_OnSelectedCellsChanged" x:Name="radGridView" Margin="10" ItemsSource="{Binding Enquiries}" ShowGroupPanel="False" AutoGenerateColumns="False" Height="380" IsFilteringAllowed="False" DataLoaded="RadGridView1_OnDataLoaded">
          <i:Interaction.Triggers>
            <i:EventTrigger EventName="Sorting">
              <cmd:EventToCommand Command="{Binding SortingCommand}" PassEventArgsToCommand="True"></cmd:EventToCommand>
            </i:EventTrigger>
          </i:Interaction.Triggers>
          <telerik:RadContextMenu.ContextMenu>
              <telerik:RadContextMenu>
                    <i:Interaction.Triggers>
                      <i:EventTrigger EventName="ItemClick">
                        <cmd:EventToCommand Command="{Binding GetEnquiryCommand}" CommandParameter="{Binding ElementName=radGridView, Path=SelectedRow}"></cmd:EventToCommand>
                      </i:EventTrigger>
                    </i:Interaction.Triggers>                <telerik:RadMenuGroupItem Background="LightSkyBlue">
                  <telerik:RadMenuItem Header="Mark as Complete"></telerik:RadMenuItem>
                  <telerik:RadMenuItem Header="Link to UW Reference"></telerik:RadMenuItem>
                </telerik:RadMenuGroupItem>
                <telerik:RadMenuGroupItem Background="LightSkyBlue">
                  <telerik:RadMenuItem Header="Edit Enquiry">
                  </telerik:RadMenuItem>
                  <telerik:RadMenuItem Header="View Enquiry">
                  </telerik:RadMenuItem>
                </telerik:RadMenuGroupItem>
              </telerik:RadContextMenu>
          </telerik:RadContextMenu.ContextMenu>
          <telerik:RadGridView.ChildTableDefinitions>
            <telerik:GridViewTableDefinition/>
          </telerik:RadGridView.ChildTableDefinitions>
          <telerik:RadGridView.Columns>
            <telerik:GridViewDataColumn DataMemberBinding="{Binding EnquiryId}" Header="ID" IsCustomSortingEnabled="True" HeaderCellStyle="{StaticResource HeaderCellStyle}"/>
            <telerik:GridViewDataColumn DataMemberBinding="{Binding AssuredName}" Header="Assured" IsCustomSortingEnabled="True" HeaderCellStyle="{StaticResource HeaderCellStyle}"/>
            <telerik:GridViewDataColumn DataMemberBinding="{Binding RaterModelVersion.RaterModel.RaterModelName}" Header="Product" IsCustomSortingEnabled="True" HeaderCellStyle="{StaticResource HeaderCellStyle}"/>
            <telerik:GridViewDataColumn DataMemberBinding="{Binding BrokerName}" Header="Broker Name" IsCustomSortingEnabled="True" HeaderCellStyle="{StaticResource HeaderCellStyle}"/>
            <telerik:GridViewDataColumn DataMemberBinding="{Binding EnquiryStatus}" Header="Status"  IsSortable="False" HeaderCellStyle="{StaticResource HeaderCellStyle}"/>
            <telerik:GridViewDataColumn DataMemberBinding="{Binding Underwriter}" Header="UW"  IsSortable="False" HeaderCellStyle="{StaticResource HeaderCellStyle}"/>
            <telerik:GridViewDataColumn DataMemberBinding="{Binding ChangedDate}" Header="Modified Date" IsCustomSortingEnabled="True" HeaderCellStyle="{StaticResource HeaderCellStyle}"/>
            <telerik:GridViewDataColumn DataMemberBinding="{Binding ChangedBy}" Header="Modified By"  IsSortable="False" HeaderCellStyle="{StaticResource HeaderCellStyle}"/>
            <telerik:GridViewDataColumn DataMemberBinding="{Binding Comments}" Header="UW Comments"  IsSortable="False" HeaderCellStyle="{StaticResource HeaderCellStyle}" Width="*"/>
          </telerik:RadGridView.Columns>
          <telerik:RadGridView.SortDescriptors>
            <telerik:ColumnSortDescriptor  Column="{Binding Columns[\AssuredName\], ElementName=radGridView}"
                             SortDirection="Ascending" />
          </telerik:RadGridView.SortDescriptors>
          <telerik:RadGridView.HierarchyChildTemplate>
            <DataTemplate>
              <telerik:RadGridView RowIndicatorVisibility="Hidden" ItemsSource="{Binding SectionLayers}" AutoGenerateColumns="False" ShowGroupPanel="False" CanUserSortColumns="False" IsFilteringAllowed="False" DataLoaded="RadGridView1_OnDataLoaded" Width="Auto">
                <telerik:RadGridView.Columns>
                  <telerik:GridViewDataColumn DataMemberBinding="{Binding PolicyReference}" Header="UW Reference" />
                  <telerik:GridViewDataColumn DataMemberBinding="{Binding SegmentSectionLayer}" Header="Identifiers"/>
                  <telerik:GridViewDataColumn DataMemberBinding="{Binding LimitAt100Percent}" Header="Limits"/>
                  <telerik:GridViewDataColumn DataMemberBinding="{Binding ExcessAt100Percent}" Header="Excess"/>
                </telerik:RadGridView.Columns>
                <telerik:RadGridView.ChildTableDefinitions>
                  <telerik:GridViewTableDefinition/>
                </telerik:RadGridView.ChildTableDefinitions>
                <telerik:RadGridView.HierarchyChildTemplate>
                  <DataTemplate>
                    <telerik:RadGridView RowIndicatorVisibility="Hidden" ItemsSource="{Binding PremiumCurrencySplits}" AutoGenerateColumns="False" CanUserSortColumns="False" ShowGroupPanel="False" IsFilteringAllowed="False">
                      <telerik:RadGridView.Columns>
                          <telerik:GridViewDataColumn DataMemberBinding="{Binding PremiumCurrency}" Header="Premium Currency"/>
                          <telerik:GridViewDataColumn DataMemberBinding="{Binding ModelPrice}" Header="Model Price"/>
                          <telerik:GridViewDataColumn DataMemberBinding="{Binding TechnicalPrice}" Header="Tech Price"/>
                          <telerik:GridViewDataColumn DataMemberBinding="{Binding GrossGrossWrittenPremiumAt100Percentage}" Header="100% WRT Premium"/>
                          <telerik:GridViewDataColumn DataMemberBinding="{Binding ProjectedNetLossRatio}" Header="PLR"/>
                       </telerik:RadGridView.Columns>
                    </telerik:RadGridView>
                  </DataTemplate>
                </telerik:RadGridView.HierarchyChildTemplate>
              </telerik:RadGridView>
            </DataTemplate>
          </telerik:RadGridView.HierarchyChildTemplate>
        </telerik:RadGridView>


Any ideas ?  Here's my VM code:

private async void GetEnquiry(object enquiry) { }
Kalin
Telerik team
 answered on 26 Sep 2014
2 answers
111 views
Hello,

So I have a GridView in which I can add new rows and within the columns I can select some combo boxes and a date Picker.

This is how it looks before anything is changed


When I change one row at a time and click save it works, the problem is when I multiple rows and combo boxes and I don't click away From the Final Combo Box. It doesn't register the Final Combo Box changed. Pictures below will illustrate what's happening.


Notice the second "Maintained" is currently showing within a combobox, that means it won't register the change until it's clicked away.


You can see here that after the save button is clicked, it reverts back to the value it was before because it wasn't "Registered"



But if I click away such that the ComboBox stops appearing and click save, it works. Image Below.


May I ask How to fix this? 




































Dimitrina
Telerik team
 answered on 26 Sep 2014
7 answers
224 views
Hi,

actually with the control I have a FilteringBehavior which display only the items in the dropdown that contain what I typed. When I have a lot of items in the dropdown the control take some time to display the dropdown even of the MaxDropDownHeight property is set to 250 and I would like to know if it's possible to increase the speed of the popup display?!?

Thank's
Alain
Kalin
Telerik team
 answered on 26 Sep 2014
2 answers
207 views
Hello there,

I do believe this question has an answer on this forum, however I could find it for now. Could you please point me in a right direction.

We have requirement to organise grid columns in 2 rows, please see attached image. How this can be achieved with GridView for wpf ?


Thanks in advance.
Roman
Top achievements
Rank 1
 answered on 26 Sep 2014
1 answer
129 views
The email was rejected somehow, so I post the reply here.

And you http://feedback.telerik.com/ can NOT upload any file!

Alex,
I have still evaluated the UI for WPF.

I found the component is not so compatible with Chinese which it is addressed as following snapshot:

1) Define some Chinese menu in XAML(Use one of demo example you provided)
(snapshot 1)

2) compile error: Invalid character specified, line 31, position 54, .'' XML invalid.
(snapshot 2)

3) If the menu is changed to ASCII, it compile successful.

Platform:
  • VS2013 Chinese version
  • Win 7 Chinese version


I hope the problem will be solved A.S.A.P before I make a decision.

Regards,
--
Steven Zou


在 2014-09-20 10:09:39,"Alex Zinn" <Alex.Zinn@telerik.com> 写道:

Hi Sun,

To follow up on my previous email, I was curious how your evaluation is going?

I also wanted to check in to see which resources (support tickets, forums, blogs, Telerik TV) you found the most useful during your evaluation, and if you encountered anything that would prevent you from recommending Telerik?

Your feedback is greatly appreciated.
Alex Zinn
Product Specialist, ALM Tools
Telerik Inc.
p: (888) 365-2779 x3223
e: Alex.Zinn@telerik.com

Are you enjoying Telerik products? Why not join our fan page on Facebook and follow us on Twitter.
Dimitrina
Telerik team
 answered on 26 Sep 2014
2 answers
284 views
After upgrading to WPF Q2 2014, the StrokeDashArray property stopped working for me.  I confirmed with the same project linking to Q1 2014 that the property is working.

Here is the XAML that reproduces the issue.  Any ideas?  Note that the Stroke and StrokeThickness properties are being updated correctly to Red and thickness 2.  It's just the StrokeDashArray that stopped working.

<chartView:ScatterLineSeries ItemsSource="{Binding LineData}" XValueBinding="XValue" YValueBinding="YValue">
     <chartView:ScatterLineSeries.StrokeShapeStyle>
          <Style TargetType="Path">
               <Setter Property="Stroke" Value="Red"/>
               <Setter Property="StrokeDashArray" Value="10 5"/>
               <Setter Property="StrokeThickness" Value="2"/>
          </Style>
     </chartView:ScatterLineSeries.StrokeShapeStyle>
</chartView:ScatterLineSeries>
Martin Ivanov
Telerik team
 answered on 26 Sep 2014
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?