Telerik Forums
UI for WPF Forum
2 answers
154 views

Hi

I have big troubles using your framework. Nowadays the docking functionality doesn't work as it should.

If I drag a panel, the panel (and also its border) is not visible while dragging. After docking the panel's titlebar is disappeared.

I'm running the latest version of your framework on visual studio 2017 (15.2).

 

Dinko | Tech Support Engineer
Telerik team
 answered on 20 Nov 2017
3 answers
270 views
I need to know if WPF RadGridView works with BindingOperations.EnableCollectionSynchronization. If not what solution you are suggesting to iterate and update my collection from worker thread?
Dilyan Traykov
Telerik team
 answered on 20 Nov 2017
6 answers
606 views

Hello,

I have a problem trying to reproduce the Radwindow as main window KB (https://www.telerik.com/support/kb/wpf/window/details/how-to-use-radwindow-as-main-window).

I'm using VB.NET with 2017.3.913.40 telerik components. I'm also using noXaml binaries.

When i run the application, nothing is visible.

I've tried todo this alos MainWindow inherits radwindow, but it's not better.

If i remove the onStartup code and set the application startupuri to MainWindow.xaml, i have the window visible, but there is another aweful window visible behind.

This problem will drive me crazy !

Thanks in advance for your answers.

Application.xaml

<Application x:Class="TelerikWpfApp13.Application"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:local="clr-namespace:TelerikWpfApp13">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Material;component/Themes/System.Windows.xaml" />
                <ResourceDictionary Source="/Telerik.Windows.Themes.Material;component/Themes/Telerik.Windows.Controls.xaml" />
                <ResourceDictionary Source="/Telerik.Windows.Themes.Material;component/Themes/Telerik.Windows.Controls.Navigation.xaml" />
                <ResourceDictionary Source="/Telerik.Windows.Themes.Material;component/Themes/Telerik.Windows.Controls.Docking.xaml" />
            </ResourceDictionary.MergedDictionaries>
            <Style TargetType="local:MainWindow" BasedOn="{StaticResource RadWindowStyle}" />
        </ResourceDictionary>
    </Application.Resources>
</Application>

 

Application.xaml.vb

Class Application
    Inherits System.Windows.Application
 
    ' Application-level events, such as Startup, Exit, and DispatcherUnhandledException
    ' can be handled in this file.
    Protected Overrides Sub OnStartup(e As StartupEventArgs)
        Call New MainWindow().Show()
        MyBase.OnStartup(e)
    End Sub
 
End Class

 

MainWindow.xaml

<telerik:RadWindow x:Class="MainWindow"
        Header="MainWindow" Height="300" Width="300">
    <Grid>
         
    </Grid>
</telerik:RadWindow>

 

MainWindow.xaml.vb

Public Class MainWindow
 
End Class

 

OD
Top achievements
Rank 1
 answered on 17 Nov 2017
1 answer
127 views

I have the following code for generating a stackedbar chart, but the bars are not visible. I have attached the screen shot of chart as well.

Can you please help me point out the issue

 

Class ChartDatas
        Public SalesRep As String
        Public LastYearValue As Double
        Public CurYearValue As Double
        Public BudgetedValue As Double

        Public Sub New(ByVal strSalesRep As String, dbLastYearVal As Double, dbCurYearVal As Double, dbBudgetedVal As Double)
            SalesRep = strSalesRep
            LastYearValue = dbLastYearVal
            CurYearValue = dbCurYearVal
            BudgetedValue = dbBudgetedVal
        End Sub
    End Class

    Private Sub ShowChart()
       
        chtComparison.SeriesMappings.Clear()
        chtComparison.DefaultView.ChartLegend.Visibility = Visibility.Collapsed
        chtComparison.DefaultView.ChartArea.DataSeries.Clear()
        chtComparison.DefaultView.ChartLegend.UseAutoGeneratedItems = True

        Dim SeriesColor As Color
        Dim seriesDef As StackedBarSeriesDefinition

        Dim ListChartData As New List(Of ChartDatas)
        ListChartData.Add(New ChartDatas("Sales Rep1", 100, 200, 300))
        ListChartData.Add(New ChartDatas("Sales Rep2", 200, 300, 200))
        ListChartData.Add(New ChartDatas("Sales Rep3", 50, 300, 200))

        Dim SeriesMap1 As New SeriesMapping() With {.LegendLabel = "Series1"}
        SeriesMap1.ItemMappings.Add(New ItemMapping("LastYearValue", DataPointMember.YValue))
        SeriesMap1.ItemMappings.Add(New ItemMapping("SalesRep", DataPointMember.XCategory))
        'SeriesMap1.SeriesDefinition = New StackedBarSeriesDefinition() With {.ShowItemLabels = True}
        SeriesColor = Color.FromRgb(0, 0, 255)
        seriesDef = New StackedBarSeriesDefinition With {.ShowItemLabels = True}
        seriesDef.Appearance.Fill = New SolidColorBrush(SeriesColor)
        SeriesMap1.SeriesDefinition = seriesDef

        Dim SeriesMap2 As New SeriesMapping() With {.LegendLabel = "Series2"}
        SeriesMap2.ItemMappings.Add(New ItemMapping("CurYearValue", DataPointMember.YValue))
        SeriesMap2.ItemMappings.Add(New ItemMapping("SalesRep", DataPointMember.XCategory))
        'SeriesMap2.SeriesDefinition = New StackedBarSeriesDefinition() With {.ShowItemLabels = True}
        SeriesColor = Color.FromRgb(0, 255, 0)
        seriesDef = New StackedBarSeriesDefinition With {.ShowItemLabels = True}
        seriesDef.Appearance.Fill = New SolidColorBrush(SeriesColor)
        SeriesMap2.SeriesDefinition = seriesDef

        Dim SeriesMap3 As New SeriesMapping() With {.LegendLabel = "Series3"}
        SeriesMap3.ItemMappings.Add(New ItemMapping("BudgetedValue", DataPointMember.YValue))
        SeriesMap3.ItemMappings.Add(New ItemMapping("SalesRep", DataPointMember.XCategory))
        SeriesColor = Color.FromRgb(255, 0, 0)
        seriesDef = New StackedBarSeriesDefinition With {.ShowItemLabels = True}
        seriesDef.Appearance.Fill = New SolidColorBrush(SeriesColor)
        SeriesMap3.SeriesDefinition = seriesDef

        'chtComparison.DefaultView.ChartArea.AxisY.AutoRange = False
        'chtComparison.DefaultView.ChartArea.AxisY.AddRange(0, 1000, 100)

        chtComparison.SeriesMappings.Add(SeriesMap1)
        chtComparison.SeriesMappings.Add(SeriesMap2)
        chtComparison.SeriesMappings.Add(SeriesMap3)
        chtComparison.ItemsSource = ListChartData

    End Sub

 

Martin Ivanov
Telerik team
 answered on 17 Nov 2017
5 answers
265 views

Hi,

I want to change selected text style. I don't have problem with change one word or line but i don't know how to select exact text and change style.

Below is code how i change style selected line.

private void Editor_OnMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {      

                var normalStyle = editor.Document.StyleRepository[HeadingName];
                var position = new DocumentPosition(editor.Document.CaretPosition);
                position.MoveToCurrentLineStart();
                editor.Document.Selection.AddSelectionStart(position);
                position.MoveToCurrentLineEnd();
                editor.Document.Selection.AddSelectionEnd(position);

                editor.ChangeSpanStyle(normalStyle);

       }

I don't find any solution to solve this problem.

Any suggestion?

Tom
Top achievements
Rank 1
 answered on 17 Nov 2017
2 answers
202 views

Hi,

I have a problem with bindning command (which is in parent ViewModel) to RadRibbonBackstageItem.

<UserControl x:Class="Project.TelerikEditor"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:telerikViewModel ="clr-namespace:Project.Modules.TelerikEditor.ViewModel"
             xmlns:optionsViewModel="clr-namespace:Project.Modules.Options.ViewModel"
             d:DesignHeight="300"
             d:DesignWidth="900"
             mc:Ignorable="d" >
   <UserControl.DataContext>
        <telerikViewModel:TelerikEditorViewModel/>
    </UserControl.DataContext>

...........

...........

...........

<telerik:RadRibbonBackstageItem Header="Options"
                                                    Icon="{telerik:IconResource IconRelativePath=16/new.png,
                                                                                IconSources={StaticResource IconSources}}"
                                                    DataContext="{Binding DataContext, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Mode=TwoWay}"
                                                    Command="{Binding OptionsWindowCommand }""
                                                    IsSelectable="false"
                                                    >

The Command don't pass to ViewModel.

Any suggestion?

 

Boby
Telerik team
 answered on 16 Nov 2017
4 answers
1.0K+ views

See that over the years there has been many issues with "Index out of range". Is this a general issue that has not been resolved yet? We are starting to use a WPF-application in production and as the load increases we get more and more of these exceptions. Looks like it can happen when we remove and item from a RadObservableCollection (or a ObservableCollection bound to a RadTimeline) and add an item right afterwards. Maybe combined with many entries in the collection.

Is there a workaround?

Here is a callstack:

2017-11-13 16:34:38,704 [106:1] ERROR Tennotech.Hilding.Watchman.App - Unhandled exception: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
2017-11-13 16:34:38,714 [106:1] DEBUG Tennotech.Hilding.Watchman.App - Stacktrace:
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at Telerik.Windows.Controls.ProjectedView`1.ObservableSourceListCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
   at System.Windows.Data.CompositeCollection.OnContainedCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Windows.WeakEventManager.ListenerList`1.DeliverEvent(Object sender, EventArgs e, Type managerType)
   at System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
   at System.Windows.Data.CollectionContainer.OnContainedCollectionChanged(NotifyCollectionChangedEventArgs args)
   at System.Windows.WeakEventManager.ListenerList`1.DeliverEvent(Object sender, EventArgs e, Type managerType)
   at System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
   at System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
   at System.Windows.Data.ListCollectionView.ProcessCollectionChangedWithAdjustedIndex(NotifyCollectionChangedEventArgs args, Int32 adjustedOldIndex, Int32 adjustedNewIndex)
   at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.RemoveItem(Int32 index)
   at System.Collections.ObjectModel.Collection`1.Remove(T item)
   at Tennotech.Hilding.Watchman.Utilities.MirroredRadList`2.SourceCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) in C:\BuildAgent\work\a6c0493e3d7aa6b\Source\Tennotech.Hilding.Watchman.Utilities\MirroredRadList.cs:line 193
   at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Data.ObservableItemCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.RemoveItem(Int32 index)
   at System.Collections.ObjectModel.Collection`1.Remove(T item)
   at Tennotech.Hilding.Watchman.Framework.Devices.GenericRecordingsSynchronizer.OnRecordingsUpdated(Object sender, ParameterizedEventArgs`1 eventArgs) in C:\BuildAgent\work\a6c0493e3d7aa6b\Source\Tennotech.Hilding.Watchman.Framework\Devices\GenericRecordingsSynchronizer.cs:line 174
   at System.Reactive.AnonymousSafeObserver`1.OnNext(T value)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

Ola
Top achievements
Rank 1
 answered on 16 Nov 2017
9 answers
430 views

Hi,

  There are switches you can use in Word to make the value of a mail merge field change case.  Ex. \* FirstCap, \* Upper, \* lower.  These don't seem to work correctly in the RichTextBox.  I'm adding the fields in code and the values display but the formatting isn't correct.  I've taken a template I made in Word and tried that which works correctly in Word but doesn't in the Telerik control so I'm not sure it is my code that is the issue.

  Any help would be appreciated.

      Troy

Boby
Telerik team
 answered on 16 Nov 2017
4 answers
568 views

Dear Sirs,

I have been working with RadVirtualGrid for WPF and I have found a problem trying to change columns' visibility. I need to do it both from code and from xaml.
I would appreciate any help with it.

I'm working with DataProvider, if this info helps in anyway.

Thanks in advance,

Stefan
Telerik team
 answered on 16 Nov 2017
3 answers
111 views

I manually set the color of a Line Series in xaml as Blue. Now in tooltip I also want the same color.

<telerik:LineSeries x:Name=ser1 ItemsSource="{Binding Data}"
CategoryBinding="Name" Stroke="Blue" ValueBinding="Value">
   <telerik:LineSeries.TooltipTemplate>
        <DataTemplate>
             <SatckPanel>
                <ItemsControls ItemsSource="{Binding}">
                    <ItemsControl.Template>
                        <DataTemplate>
                           <Ellipse Width="12" Height="12" Fill="Blue">
                    ....
                        </DataTemplate>
                     </ItemsControl.Template>
                <ItemsControls>
            </StackPanel>
         </DataTemplate>
    </telerik:LineSeries.TooltipTemplate>
</telerik:LineSeries>

Now my question if we don't use hard code how can we make the colors same?

Trump
Top achievements
Rank 1
 answered on 16 Nov 2017
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
DataPager
PersistenceFramework
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
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?