Telerik Forums
UI for WPF Forum
6 answers
343 views
Hello @all,

our problem is the RadTreeView always jumping to the top when wrapped like in the xaml below. It took a long time to find out, but in this way I was able to reproduce it. We disabled the ScrollViewer of the RadPanelBar so we can scroll to certain items in the TreeView in the original context.

Expand the RadPanelBarItem, scroll down, select an item there. Move the GridSplitter or just resize the window and the RadTreeView's ScrollViewer jumps back to the top.
Change the RadTreeView and its items to the standard WPF TreeView and items and it stays scrolled where it is. Unfortunately we would be missing certain features of the RadTreeView we would like to use.

<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*" />
        <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>
    <Controls:RadPanelBar ScrollViewer.HorizontalScrollBarVisibility="Disabled" 
                                      ScrollViewer.VerticalScrollBarVisibility="Disabled">
        <Controls:RadPanelBarItem>
            <Controls:RadTreeView Grid.Column="0" 
                                  HorizontalAlignment="Stretch"
                                  Animation:AnimationManager.IsAnimationEnabled="False">
                <Controls:RadTreeViewItem Header="1">
                    <Controls:RadTreeViewItem Header="2" />
                    <Controls:RadTreeViewItem Header="2" />
                     <!-- Insert items until the vertical scroll bar can scroll down -->
                </Controls:RadTreeViewItem>
            </Controls:RadTreeView>
        </Controls:RadPanelBarItem>
    </Controls:RadPanelBar>
    <GridSplitter Grid.Column="0" Width="3" HorizontalAlignment="Right" />
    <Button Grid.Column="1">Test</Button>
</Grid>


Any ideas how we could fix this?

Kind regards,
M. Lohmann.
Petar Mladenov
Telerik team
 answered on 30 Sep 2014
5 answers
581 views
Dear Concerned

I have checked documentation for Bar code 128 and other barcodes but not able to get how to print it.
I have reached to barcode silveright and WPF . Where it is explained that
Private void Button_Click( object sender, RoutedEventArgs e)
{
   PrintDocument document =  new PrintDocument ();
    document.PrintPage += (s, args) =>
    {
       args.PageVisual = this.radBookItem1;
    };
    document.Print("Silverlight Printing Demo");
};

but not getting "PrintDoument" dll, Also if feasible please provide sample in vb.net

Thanks in Advance.
paul
Top achievements
Rank 1
 answered on 30 Sep 2014
1 answer
168 views
I have ribbon with contextual tabs.

01.<telerik:RadRibbonWindow x:Class="WpfApp.MainWindow"
04.        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
05.        Title="MainWindow" Height="350" Width="525">
06.    <telerik:RadRichTextBoxRibbonUI>
07.        <telerik:RadRibbonTab Header="Tab1">
08.            <telerik:RadRibbonGroup Header="BBB">
09.                <telerik:RadToggleButton Name="ToggleButton" Content="Show" />
10.            </telerik:RadRibbonGroup>
11.        </telerik:RadRibbonTab>
12.         
13.        <telerik:RadRibbonTab ContextualGroupName="TestTab" Header="Tab2">
14.            <telerik:RadRibbonGroup Header="AAA">
15.                <telerik:RadRadioButton Name="TARGET_BUTTON" Content="ClickMe" />
16.            </telerik:RadRibbonGroup>
17.        </telerik:RadRibbonTab>
18.         
19.        <telerik:RadRichTextBoxRibbonUI.ContextualGroups>
20.            <telerik:RadRibbonContextualGroup Header="Test" IsActive="{Binding IsChecked, ElementName=ToggleButton}" Color="BlueViolet" GroupName="TestTab" />
21.        </telerik:RadRichTextBoxRibbonUI.ContextualGroups>
22.    </telerik:RadRichTextBoxRibbonUI>
23.</telerik:RadRibbonWindow>


 I try get access to element with name "TARGET_BUTTON" with UI Automation API.
01.var app = AutomationElement.RootElement.FindFirst(TreeScope.Children, new PropertyCondition(AutomationElement.NameProperty, "My Application"));
02.var allChildren = TreeWalker.RawViewWalker.GetParent(app).FindAll(TreeScope.Descendants, Condition.TrueCondition);
03. 
04.foreach (AutomationElement automationElement in allChildren)
05.{
06.    try
07.    {
08.        if (automationElement.Current.AutomationId == "TARGET_BUTTON")
09.        {
10.            Console.WriteLine("{0} ({1})", automationElement.Current.ClassName, automationElement.Current.AutomationId);
11.        }                  
12.    }
13.    catch { }
14.}

But this code don't find the button.
If I set in line 20 IsActive="true" then I can find the button.
I use last version of UI for WPF.
Kiril Vandov
Telerik team
 answered on 29 Sep 2014
2 answers
188 views
Where should i attach the event to make it work properly?

Now i attach it to a RadPane, but it only works aslong as some objeckt inside the RadPane is focused. If i have the "frame" of the RadPane focused, say after i reposition it, the KeyDown will not fire. 

I have tried to attach the event to almost every object above the RadPane in the hierarchy but no luck so far...

Pseudu:

Grid
  RadDocking
    RadSplitContainer
      RadPaneGroup   <-- Inside here we dynamically add RadPanes
    /RadSplitContainer
  /RadDocking
/Grid



Alek
Telerik team
 answered on 29 Sep 2014
2 answers
451 views
Hi there,

I'm having some strange troubles with the RadGridView. I'm populating the grid dynamically in code behind in the Loaded event because the number of columns needed is not known at design time. So far so good and after the data is loaded the grid looks fine. Column and row virtualization are enabled by default, vertical scrolling works and performance is really good. BUT horizontal scrolling does look really strange. The column headers do not move at all and the visible cells just move out to the left side of the grid while something that looks like empty grid rows moves into view by scrolling further to the right. This happens out of the box before I even start fiddling around with the various properties of the RadGridView.

If I turn off column virtualization part of the issue goes away. Headers still don't move and performance of loading and scrolling becomes really bad because there can be hundreds of columns. I tried to change almost every setting on the grid but I can't seem to get rid of the problem...

Regards,
Marcel
Yoan
Telerik team
 answered on 29 Sep 2014
1 answer
234 views
I'm building a prototype of an application that will utilize offline data from OpenStreetMap.org. So far, I spun up a new WPF project and threw together a quick RadMap using the OSM data provider. The application works but now I want implement a local data source. I downloaded a small dataset from the OSM website. The data is an OSM file and contains XML.

How do I use this file with the RadMap control? I'm new to the RadMap control but have worked with .NET / XML / GIS for years.

Thanks!
Pavel R. Pavlov
Telerik team
 answered on 29 Sep 2014
5 answers
252 views
Hello,

I'm using your ChartView in combination with a TreeView and selectable series. I have bound the series visibility to a Checked-Property on my series elements. When I check some series they are drawn in the Chart and the axis scales accordingly. But there is one problem: It does only increase the displayed range and there is no change when I disable the series that caused the range-adaption. So I'm looking for a way to tell the Chart that it must auto-range the whole display area so I have the best view on it. I haven't found such a method and the frameworks UpdateLayout(), Arrange() don't work. Is there any way to accomplish that?

Thanks in advance!

Best regards,
Peter Schmidt
Pavel R. Pavlov
Telerik team
 answered on 29 Sep 2014
5 answers
334 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
125 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
403 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
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?