Telerik Forums
UI for WPF Forum
3 answers
161 views
I'm using a RadScheduleView with some combobox dropdowns to set filter options. Here's how I set this up (excess code has been removed):

<UserControl x:Class="CalendarsContainer"
    <Grid x:Name="ScheduleGrid">
        <Grid.DataContext>
            <viewModels:CalendarViewModel />
        </Grid.DataContext>
        <telerik:RadComboBox Grid.Row="0" SelectedValue="{Binding TaskFilter, Mode=TwoWay}"/>
        <telerik:RadScheduleView Grid.Row="1" AppointmentsSource="{Binding Appointments}">
            <telerik:RadScheduleView.ViewDefinitions>
                <telerik:MonthViewDefinition AppointmentFilter="{Binding AppointmentFilter}" />
            </telerik:RadScheduleView.ViewDefinitions>
        </telerik:RadScheduleView>
    </Grid>
</UserControl>


When I use this, I get a binding error after it's first initialized:

Get System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=AppointmentFilter; DataItem='CalendarViewModel' (HashCode=6511533); target element is 'MonthViewDefinition' (HashCode=63187382); target property is 'AppointmentFilter' (type 'Predicate`1')

But other than that, everything works as I expect. My appointments are displayed as per my filter settings. As I change my dropdown, the AppointmentFilter gets called for every appointment and the visible appointments are changed to match the filter.

But, if I remove setting of the DataContext from the xaml:

<UserControl x:Class="CalendarsContainer"
    <Grid x:Name="ScheduleGrid">
        <telerik:RadComboBox Grid.Row="0" SelectedValue="{Binding TaskFilter, Mode=TwoWay}"/>
        <telerik:RadScheduleView Grid.Row="1" AppointmentsSource="{Binding Appointments}">
            <telerik:RadScheduleView.ViewDefinitions>
                <telerik:MonthViewDefinition AppointmentFilter="{Binding AppointmentFilter}" />
            </telerik:RadScheduleView.ViewDefinitions>
        </telerik:RadScheduleView>
    </Grid>
</UserControl>

and move it to the code behind:

public CalendarsContainer()
{
    InitializeComponent();
    ScheduleGrid.DataContext = new CalendarViewModel();
}

Now, instead of seeing the "governing FrameworkElement" binding error first, the AppointmentFilter is called for each appointment right away, but then I get the binding error at the end:

System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=AppointmentFilter; DataItem=null; target element is 'MonthViewDefinition' (HashCode=32578312); target property is 'AppointmentFilter' (type 'Predicate`1')

At this point, ALL appointments are displayed, not just the ones that meet the filter requirements.

Even worse is that, as I change the dropdown, the AppointmentFilter gets called for every appointment as I expect, but the visible appointments don't change!! For some reason, the AppointmentFilter is called, but then completely ignored, so all appointments are displayed.

As far as I can tell, the governing FrameworkElement binding is known WPF behavior. What I don't understand is why RadScheduleView doesn't fully recover from this. Since the AppointmentFilter is being called, it seems to partially recover, but then the results of the filtering are ignored.

How can I fix this problem?

Thank you!
George
Telerik team
 answered on 16 May 2014
3 answers
196 views
How do I localize the number format used in RadGridView for double to German culture (1.23 is written in German culture 1,23)?

Take a very simple RadGridView like in the "Getting Started" example for RadGridView (http://www.telerik.com/help/wpf/gridview-getting-started2.html).
On a clean new VS2010 Telerik RadControls project on my German Win7 machine, the header block ("Drag a column header and drop it here ...") is displayed correctly in German ("Ziehen Sie einen Spaltenkopf auf diese Fläche ..."), but cells of columns that represent a  property of type double will not work correctly with German culture. When I enter e.g. the German value half (0,5) it will be interpreted as five (5).

How do I change this?

I already tried

            InitializeComponent();
            LocalizationManager.DefaultCulture = new System.Globalization.CultureInfo("de");

But it does not work...

Mende
Top achievements
Rank 1
 answered on 15 May 2014
2 answers
252 views
I am trying to remove the mouseover row highlight on a RadGridView. I've followed the instructions here, but I put the style in a resource dictionary. Here is the App.xaml:

<ResourceDictionary>
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Styles/GridViewRowStyle.xaml"/>
    </ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

And the RadGridView xaml:

<telerik:RadGridView x:Name="statusGrid" AutoGenerateColumns="False" CanUserDeleteRows="False"
         CanUserInsertRows="False" ItemsSource="{Binding Status}"
         IsReadOnly="True" RowStyle="{DynamicResource GridViewRowStyle}">

This style is completely ignored if it is in an external file. If I do the same procedure as in the stated in the documentation but put it in the MainWindow.xaml file, it works correctly. Why is this?
Karen
Top achievements
Rank 1
 answered on 15 May 2014
1 answer
146 views
Our product use telerik Richtextbox editor  and  currently there is no turkish lira symbol support. Is there a way to add support Turkish Lira symbol to the editor. Thanks anyway.
Missing User
 answered on 15 May 2014
1 answer
93 views
Hi,
I have a radCarousel control with custom items. When I show first time, it shows all items, but when the user move mouse pointer over it, all items disappear from carousel and Output windows show this:

System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=ReflectionSettings.HiddenPercentage; DataItem=null; target element is 'GradientStop' (HashCode=36177439); target property is 'Offset' (type 'Double')
System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:(no path); DataItem=null; target element is 'VisualBrush' (HashCode=13645305); target property is 'Visual' (type 'Visual')


This is my XAML Code:
<Window.Resources>
<Style TargetType="{x:Type telerik:CarouselItem}">
<Setter Property="Height" Value="600"/>
<Setter Property="Width" Value="400"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type telerik:CarouselItem}">
<Grid>
<Rectangle HorizontalAlignment="Center" VerticalAlignment="Top" Width="300" Height="400" RadiusX="6" RadiusY="6" StrokeThickness="1" Stroke="#FF47587C" Fill="Black"/>
<Rectangle x:Name="recName"  Margin="60,10,60,540"  Stroke="Black" 
                                       RadiusX="6" RadiusY="6" StrokeThickness="1">
<Rectangle.Fill>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" x:Name="X">
<GradientStop Color="#FF020F1F" Offset="0.138"/>
<GradientStop Color="#FF032247" Offset="1"/>
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<ContentPresenter IsHitTestVisible="True"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type telerik:CarouselDataRecordPresenter}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type telerik:CarouselDataRecordPresenter}">
<StackPanel HorizontalAlignment="Center" TextElement.FontSize="20" TextElement.FontWeight="Bold" TextElement.Foreground="#FFBEC4DE">
<Label Content="{Binding Path=Fullname}" Margin="0,13,0,19" HorizontalAlignment="Center" TextElement.Foreground="#FFBEC4DE"/>
<Image x:Name="imgInternal"  Width="274" Height="270" Stretch="Fill" Source="{Binding Path=PictureFullPath}" />
<Label HorizontalAlignment="Center" Margin="0,10,0,0"  Content="{Binding Path=Position}" TextElement.FontSize="16" TextElement.FontWeight="Normal" TextElement.Foreground="#FFBEC4DE"/>
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>

This is radCarousel control: 
<telerik:RadCarousel  x:Name="rcUsers" Background="Black" Height="500" Margin="100,50,100,-120" HorizontalAlignment="Center" VerticalAlignment="Top" VerticalScrollBarVisibility="Hidden" HorizontalScrollBarVisibility="Hidden" SelectionChanged="rcUsers_SelectionChanged" MouseDoubleClick="rcUsers_MouseDoubleClick" />

Thanks in advance,

Carlos De Jesus







Boris
Telerik team
 answered on 15 May 2014
1 answer
93 views
RadDataForm does not validates correctly objects inherited from ICustomTypeDescriptor because it uses standard Validator.TryValidateObject method which works with standard reflection. Insteed it must use internal dynamic PropertyDescriptors and validate object by them.

RadDataForm.cs: 
public bool ValidateItem()
        {
            //...
            Validator.TryValidateObject(CurrentItem, new ValidationContext(CurrentItem, null, null), validationResults, true);
            //...
        }

Ivan Ivanov
Telerik team
 answered on 15 May 2014
1 answer
246 views
Hello,

I have problem with RadDataPager. If I try to write specific page number into current page textbox and press enter key (or tab key as well), nothing happens, only LostKeyboardFocus is fired. These are the only two keys that fires that event. Have you faced that issue before?

This is the code of my page:

<UserControl
    x:Class="GTrade.App.Views.TradeTickets.TradeTicketSearchView"
    xmlns:cal="http://www.caliburnproject.org"
    xmlns:convertors="clr-namespace:GTrade.App.Helpers.Convertors"
    Background="Transparent" Language="cs-CZ"
    mc:Ignorable="d" d:DesignHeight="200" d:DesignWidth="800">
     
    <UserControl.Resources>
        <convertors:WidthConverter x:Key="WidthConverter" />
        <DataTemplate x:Key="TotalPriceWithCurrency">
            <TextBlock Text="{Binding TotalPriceWithCurrency}" HorizontalAlignment="Right" />
        </DataTemplate>
    </UserControl.Resources>
 
    <telerik:RadBusyIndicator IsBusy="{Binding Busy.IsBusy}">
 
            <Grid>
 
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
 
                <telerik:RadGridView
                    Grid.Row="0"
                    x:Name="Grid"
                    ItemsSource="{Binding Items}"
                    SelectedItem="{Binding CurrentItem}"
                    RowIndicatorVisibility="Collapsed"
                    IsReadOnly="True"
                    AutoGenerateColumns="False"
                    CanUserReorderColumns="True"
                    CanUserFreezeColumns="False"
                    ShowGroupPanel="False"
                    HorizontalAlignment="Left"
                    MaxHeight="500"
                    cal:Message.Attach="[Event RowActivated] = [Action ChangeSelectedItem(Grid.SelectedItem)]"
                    >
                    <telerik:RadGridView.Columns>
                        <telerik:GridViewDataColumn Header="ID" Width="60"
                            DataMemberBinding="{Binding Id}" TextAlignment="Right"/>
                        <telerik:GridViewDataColumn Header="Název obchodu" Width="160"
                            DataMemberBinding="{Binding Name}" />
                        <telerik:GridViewDataColumn Header="Typ obch." Width="100"
                            DataMemberBinding="{Binding TradeType}" />
                        <telerik:GridViewDataColumn Header="Produkt" Width="100"
                            DataMemberBinding="{Binding Product}" />
                        <telerik:GridViewDataColumn Header="Obchodník" Width="100"
                            DataMemberBinding="{Binding Trader.Name}" />
                        <telerik:GridViewDataColumn Header="Cílová kniha" Width="120"
                            DataMemberBinding="{Binding SellPortfolio.Name}" />
                        <telerik:GridViewDataColumn Header="Dod. bod" Width="85"
                            DataMemberBinding="{Binding DeliveryPoint.Name}" />
                        <telerik:GridViewDataColumn Header="Protistrana" Width="125"
                            DataMemberBinding="{Binding Partner.Name}" />
                        <telerik:GridViewDataColumn Header="Datum od" Width="100"
                            DataMemberBinding="{Binding StartDate}"
                            DataFormatString="{}{0:d}" TextAlignment="Right"/>
                        <telerik:GridViewDataColumn Header="Datum do" Width="100"
                            DataMemberBinding="{Binding EndDate}"
                            DataFormatString="{}{0:d}" TextAlignment="Right"/>
                        <telerik:GridViewDataColumn Header="Datum založení" Width="120"
                            DataMemberBinding="{Binding TradeDate}"
                            DataFormatString="{}{0:d}" TextAlignment="Right" />
                        <telerik:GridViewDataColumn
                            Header="Cena celkem" Width="165"
                            DataFormatString=""
                            DataMemberBinding="{Binding TotalPrice}"
                            CellTemplate="{StaticResource TotalPriceWithCurrency}"
                            />
                        <telerik:GridViewColumn Width="*" />
                    </telerik:RadGridView.Columns>
                </telerik:RadGridView>
 
                <telerik:RadDataPager
                    x:Name="DataPager"
                    Grid.Row="1"
                    PageSize="50"
                    Source="{Binding Items, ElementName=Grid}"
                    IsTotalItemCountFixed="False"
                    DisplayMode="All"
                    AutoEllipsisMode="None"
                    NumericButtonCount="10"
                    Width="{Binding Path=ActualWidth,
                                    ElementName=Grid,
                                    Converter={StaticResource WidthConverter}}"
                    HorizontalAlignment="Center"
                    LostKeyboardFocus="DataPager_OnLostKeyboardFocus"
                />
            </Grid>
 
    </telerik:RadBusyIndicator>
     
</UserControl>


Thank you very much.
Karel Bem
Yoan
Telerik team
 answered on 15 May 2014
2 answers
174 views
How to change the main color of RadGridView
from black to red

graciously
André
Boris
Telerik team
 answered on 15 May 2014
1 answer
268 views
The samples provided with the BreadCrumb control suggest it can be used to coordinate navigation through a directory tree, but the provided samples all use static content to populate the BreadCrumb control's ItemSource data.

How can the BreadCrumb control be used with dynamic content?  For example, an XML representation that consists of an XPath that has a "Name" for a given "Folder" to represent a particular directory path where the path is built up dynamically as you navigate toward a particular target directory:

C:\Root\test1\test2\

[C:\] ^| [Root]^| [test1]^ | [test2]^

Where each breadcrumb shown above has it's data populated as you select the next, rather than having the entire path pre-built, as shown in the provided examples?

You would not know the target directory in advance of navigation if the Breadcrumb control were used in this manner, so the provided examples are not representative of actual usage for this scenario.

Sample XML:
<XmlDataProvider x:Key="FolderRoot">
<x:XData>
<Folder xmlns="" Name="C:\">
</Folder>
</x:XData>
</XmlDataProvider>

Note: the above XML is built dynamically as you navigate through directory structure.  This is just the very first node.

Martin Ivanov
Telerik team
 answered on 15 May 2014
4 answers
125 views
Hello,

consider the following xaml:

    <telerik:RadDateTimePicker SelectionChanged="RadDateTimePicker_OnSelectionChanged" />

In the code-behind, there's this:

    private void RadDateTimePicker_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
    {
        throw new Exception("Exception!");
    }

Even if you add event handlers to the necessary events in App.xaml.cs (DispatcherUnhandledException and AppDomain.CurrentDomain.UnhandledException), these will never be triggered.

Do the same with a normal Button and the events will fire.

Is RadDateTimePicker(.SelectionChanged) swallowing these exceptions?

My application is a little more complex (with MVVM and a Command), but it boils down to that. So is there any way of catching these exceptions too? I want a general exception handler in my App.xaml.cs for any non-specific cases I didn't (or chose not to) handle. It would be cumbersome if I'd have to add try-catches for every command that's fired by a RadDateTimePicker (and a leaking of knowledge about the UI in my ViewModel).
Konstantina
Telerik team
 answered on 15 May 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
ProgressBar
Sparkline
LayoutControl
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
Rating
SplashScreen
Accessibility
Callout
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
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?