Telerik Forums
UI for WPF Forum
15 answers
468 views
I have a ScheduleView with the following setup - the actual time spawn and tick marks are being provided by the view model:

<telerik:RadScheduleView.ViewDefinitions>
    <telerik:TimelineViewDefinition MinorTickLength="{Binding MinorTickLength}" MinTimeRulerExtent="{Binding MinTimeRulerExtent}" DayStartTime="{Binding StartTime, Mode=OneWay}" DayEndTime="{Binding EndTime, Mode=OneWay}"  MajorTickLength="1h" Orientation="Vertical" StretchGroupHeaders="True" StretchAppointments="True" VisibleDays="1"/>
    <telerik:DayViewDefinition      MinorTickLength="{Binding MinorTickLength}" MinTimeRulerExtent="{Binding MinTimeRulerExtent}" DayStartTime="{Binding StartTime, Mode=OneWay}" DayEndTime="{Binding EndTime, Mode=OneWay}"  MajorTickLength="1h" TimerulerMajorTickStringFormat="{}{0:t}" Title="Shift" />
    <telerik:WeekViewDefinition     MinorTickLength="{Binding MinorTickLength}" MinTimeRulerExtent="{Binding MinTimeRulerExtent}" DayStartTime="{Binding StartTime, Mode=OneWay}" DayEndTime="{Binding EndTime, Mode=OneWay}"  MajorTickLength="1h" />
    <telerik:MonthViewDefinition />
</telerik:RadScheduleView.ViewDefinitions>


Now, the problem is that the first view definition doesn't pick up the bindings. The timeline view shows a full day view with the default tick mark lengths. Day view and week view display just fine. Now, if I remove the timeline view definition from my XAML and restart the application, the day view is affected, while the week view still works fine. This looks like a bug to me - and it's a show stopping one.

Thanks for your advice
Philipp
Wetzorke
Top achievements
Rank 1
 answered on 09 Nov 2016
1 answer
95 views

how to create a Relation between two classes from code behind. created a relation for particular class but unable to define relation.

 

Martin Ivanov
Telerik team
 answered on 09 Nov 2016
4 answers
141 views

An unhandled ArgumentNullException  exception appears after scrolling of the document to the third page,and the document is viewed fine at least in chrome and edge browsers.

Here is the stack trace:

System.ArgumentNullException: Value cannot be null.
Parameter name: source
   at Telerik.Windows.Documents.Fixed.FormatProviders.Old.Pdf.PdfElementToFixedElementTranslator.CreateDestination(Destination source, PdfFormatProvider provider)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Old.Pdf.PdfElementToFixedElementTranslator.CreateGoToAction(GoToAction source, PdfFormatProvider provider)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Old.Pdf.PdfElementToFixedElementTranslator.CreateAction(Action source, PdfFormatProvider provider)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Old.Pdf.PdfElementToFixedElementTranslator.CreateLinkAnnotation(Link source, PdfFormatProvider provider)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Old.Pdf.PdfElementToFixedElementTranslator.CreateAnnotation(Annot source, PdfFormatProvider provider)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider.CopyAnnotationsFromPageSource(Page source, AnnotationCollection annotations)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider.LoadPageAnnotations(RadFixedPage page)
   at Telerik.Windows.Documents.Fixed.Model.RadFixedPage.LoadAnnotations()
   at Telerik.Windows.Documents.Fixed.UI.Layers.AnnotationsUILayer.Initialize(UILayerInitializeContext context)
   at Telerik.Windows.Documents.UI.FixedPagePresenterBase.InitializeUILayers(UILayerInitializeContext context)
   at Telerik.Windows.Documents.UI.FixedPagePresenter.InitializeUILayers(UILayerInitializeContext context)
   at Telerik.Windows.Documents.UI.FixedDocumentPresenterBase.GetPagePresenter(FixedPageLayoutInfo pageInfo)
   at Telerik.Windows.Documents.UI.FixedDocumentPagesPresenter.UpdateVisiblePages(IEnumerable`1 visiblePages)
   at Telerik.Windows.Documents.UI.FixedDocumentPagesPresenter.ArrangeOverride(Size arrangeBounds)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.ContextLayoutManager.UpdateLayout()
   at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
   at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   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)

Can you please help with this error investigation?

The problem document: https://drive.google.com/file/d/0B8STNPYlNrMqZlpRS0RiRkdyeFE/view?usp=sharing

Telerik version is 2015.3.1104.45
We are using it with .net 4.6.1, under Windows 10

Tanya
Telerik team
 answered on 09 Nov 2016
1 answer
763 views
<Viewbox x:Key="organization">
        <Grid Width="128" Height="128" Visibility="Visible">
            <Path Data="M28,26C26.896999,26 26,26.896999 26,28 26,29.103001 26.896999,30 28,30 29.103001,30 30,29.103001 30,28 30,26.896999 29.103001,26 28,26z M16,26C14.897,26 14,26.896999 14,28 14,29.103001 14.897,30 16,30 17.103,30 18,29.103001 18,28 18,26.896999 17.103,26 16,26z M4,26C2.8969998,26 2,26.896999 2,28 2,29.103001 2.8969998,30 4,30 5.1029999,30 6,29.103001 6,28 6,26.896999 5.1029999,26 4,26z M28,24C30.205999,24 32,25.794001 32,28 32,30.205999 30.205999,32 28,32 25.794001,32 24,30.205999 24,28 24,25.794001 25.794001,24 28,24z M16,24C18.206,24 20,25.794001 20,28 20,30.205999 18.206,32 16,32 13.794,32 12,30.205999 12,28 12,25.794001 13.794,24 16,24z M4,24C6.2060001,24 8,25.794001 8,28 8,30.205999 6.2060001,32 4,32 1.7940001,32 0,30.205999 0,28 0,25.794001 1.7940001,24 4,24z M4.5,15.053021L27.5,15.053021C28.327,15.053021,29,15.72602,29,16.553017L29,23 27,23 27,17.053017 17,17.053017 17,23.000999 15,23.000999 15,17.053017 5,17.053017 5,23 3,23 3,16.553017C3,15.72602,3.6729999,15.053021,4.5,15.053021z M11,2L11,8 21,8 21,2z M10.5,0L21.5,0C22.326996,0,23,0.67297363,23,1.5L23,8.5C23,9.3270264,22.326996,10,21.5,10L17,10 17,14.032018 15,14.032018 15,10 10.5,10C9.6730042,10,9,9.3270264,9,8.5L9,1.5C9,0.67297363,9.6730042,0,10.5,0z" Stretch="Uniform" Fill="#FF235598" Width="98" Height="98" Margin="0,0,0,0" RenderTransformOrigin="0.5,0.5">
                <Path.RenderTransform>
                    <TransformGroup>
                        <TransformGroup.Children>
                            <RotateTransform Angle="0" />
                            <ScaleTransform ScaleX="1" ScaleY="1" />
                        </TransformGroup.Children>
                    </TransformGroup>
                </Path.RenderTransform>
            </Path>
        </Grid>
    </Viewbox>

 

I have icons that are available as XAML code (Viewbox). I would like to add a XAML Icon to the button. The following code works:

 

<telerik:RadButton Height="250" Width="250" Content="{DynamicResource organization}"/>

 

This code does not work:

<telerik:RadRibbonButton x:Name="btnShowDashbord" Content="Home" LargeImage="{DynamicResource organization}" Size="Large" />

 

How can I include an XAML icon as ImageSource?

 

 

Tanya
Telerik team
 answered on 09 Nov 2016
2 answers
93 views

Hi,

We've created a base class/control which implements RadGridView (i.e. BaseGridView : RadGridView) which features code-behind logic that is bound to the UI's RadGridView, which we'd like to use across our application to elimintate repeated code.

We were able to create a solution that worked, however, we were required to create the RadContextMenu and the items manually in the base controls' constructor, where we would prefer to declare the RadContextMenu and the items in the XAML of the base control, like so:

<telerik:RadGridView x:Class="MyModule.BaseGridView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
...
<telerik:RadContextMenu x:Name="GridContextMenu">
            <telerik:RadContextMenu.Items>
                <telerik:RadMenuItem Name="mnuFilterItem" Header="Filter Selected" Click="FilterMenuItem_OnClick"/>
            </telerik:RadContextMenu.Items>
        </telerik:RadContextMenu>
</telerik:RadContextMenu.ContextMenu>
...
</telerik:RadGridView>

Here is sample usage in a View which implements the base control:

...

<views:BaseGridView Grid.Row="1" 
                            ItemsSource="{Binding Path=MyData}" 
                             AutoGenerateColumns="False" 
                             IsReadOnly="False" 
                             RowIndicatorVisibility="Visible"
                             HorizontalAlignment="Stretch"
                             SelectionMode="Extended"
                             SelectionUnit="Mixed"
                             ClipboardPasteMode="AllSelectedCells">

...

The XAML implementation is triggering the FilterMenuItem_OnClick event from the View which inherits this base view/control, however, we are experiencing a XAML exception when viewing the XAML in the designer of the View which is implementing the base control:

Method not found: 'Void Telerik.Windows.Controls.RadMenuItem.add_Click(Telerik.Windows.RadRoutedEventHandler)'.

 

Kindly advise. We have also tried manually hooking up the filter's click event in code-behind in the inheriting View's constructor like so:

mnuFilterItem.Click += new RadRoutedEventHandler(FilterMenuItem_OnClick);

However, the XAML exception in the implementing View persists.

 

Kind regards

Stefan Nenchev
Telerik team
 answered on 09 Nov 2016
5 answers
777 views
Hi,

How do I check if selectedItem intersects or overlap other shape on mouseUp?
Petar Mladenov
Telerik team
 answered on 09 Nov 2016
8 answers
216 views

Hello,

I have a very basic statement for adding InlineUIContainers to my RadRichTextBox:

var customControl = new â€‹CustomControl((​CustomObject)container.SelectedObject) { Height = 480, Width = 270 }; ​
var uiContainer      = new InlineUIContainer(customControl , new Size(480,270));
this.SelectedView.TelerikRichTextBox.InsertInline(uiContainer);

The custom control successfully displays within the RadRichTextbox, and can be size accordingly.  The problem is when I export as PDF, the resulting render control to image becomes distorted and no longer acceptable for document presentation.  The export code is as follows:

 

public byte[] ExportPDF()
{     
    PdfFormatProvider provider = new PdfFormatProvider();           
    provider.ExportSettings = new PdfExportSettings();     
    provider.ExportSettings.InlineUIContainersExportMode = PdfInlineUIContainersExportMode.Image;
    return provider.Export(this.TelerikRichTextBox.Document);
}

 

Are there properties that I am unaware of that will aid in proper rendering of the control?  

Tanya
Telerik team
 answered on 09 Nov 2016
2 answers
185 views

Ok, so I'm doing a vstudio-like interface using raddocking. I have a pane group on the left and right and mode of the user interaction will be with the right group.

I also have a radmenu and radtoolbar at the top of the main window. I have a File/Close menu option. It's bound to a CloseCommand in my MainWindow's viewmodel but I get stuck there.

Using MVVM, how best to close the RadPane? I can add the EventToCommandBehavior to the xaml. Then I can catch the command in my MainWindow's ViewModel. The problem is that once I'm in the ViewModel, I don't know how to tell the RadPane's View to close the pane in such a way that it's PreviewClose event fires so I can test to see if the user wants to save changes etc. Supposedly, in MVVM, you're not supposed to be playing with UI stuff in the VM.

To put it more simply, I want to ask the user if they need to save changes when the hit file close. I don't see how to do that in a VM without breaking MVVM rules.

Even using the examples seem to break MVVM rules. Passing a radpane to a command seems like it breaks MVVM rules.

Any insight would be greatly appreciated. (BTW, we are using prism). I am new to MVVM and right now, it seems very difficult to do simple stuff.

Thanks ... Ed

 

Randy Hompesch
Top achievements
Rank 1
 answered on 09 Nov 2016
3 answers
311 views

We have a data model which has the notion of "layers" where each layer has a collection of entities that I want to plot on the map. Each layer has properties to control layer visibility (and hence visibility of entities on that layer) on/off and also by zoom range (which differs for each layer). My thought is that I should be able to add a visualisation layer to the map control for each of the layers in my data model, but I can't see how to bind to a collection of layers. 

Is what I describe possible and/or the best approach to the problem I'm trying to solve?

Thanks.

 

 

Petar Mladenov
Telerik team
 answered on 08 Nov 2016
3 answers
142 views
I have a RadCartesianChart with a DateTimeContinuousAxis on the HorizontalAxis.  The data graphs exactly the way I want it, however I would like to display the way the horizontal AxisLabels display.  I would like them to display the total elapsed seconds from the minimum X value.  Is there some kind of template I could override?
Lance | Senior Manager Technical Support
Telerik team
 answered on 07 Nov 2016
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
Slider
Expander
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
WebCam
CardView
DataBar
Licensing
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
HighlightTextBlock
Security
TouchManager
StepProgressBar
VirtualKeyboard
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?