Telerik Forums
UI for WPF Forum
1 answer
78 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
174 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
158 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
243 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
114 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
1 answer
122 views
Hello, 

I have downloaded Diagram/MVVM_WPF examples, but when I run example, make a connection e.g. between R8 and Golf blocks, and after this move R8 block into Volkswagen container I got an exception "Unable to cast object of type 'Telerik.Windows.Controls.RadDiagramConnection' to type 'Telerik.Windows.Controls.Diagrams.Extensions.ViewModels.NodeViewModelBase'."

How to resolve this issue? 
Zarko
Telerik team
 answered on 15 May 2014
1 answer
190 views
Hello!

I am trying to change a color of RadTreeView border, but I can't find information on how to reference default border brush which is influenced by current theme.
Pavel R. Pavlov
Telerik team
 answered on 15 May 2014
3 answers
235 views
I am using the following to locate an Item in the grid and select it;
For Each item As AreaView In gvArea.Items
    If (item.AreaId = iAreaId) Then
        gvArea.SelectedItem = item
        gvArea.ScrollIntoView(item)
        Exit For
    End If
Next

However I would prefer to use something like;

Dim item As AreaView = gvArea.Items.Where(Function(f) f.AreaId = iAreaId)
gvArea.SelectedItem = item
gvArea.ScrollIntoView(item)

I have tried the above using "gvArea.Items", "gvArea.ItemsSource" and "gvArea.DataContext" with no luck.

Thanks in advance...
Raymond
Top achievements
Rank 1
 answered on 15 May 2014
3 answers
130 views
Hi,

Was trying to get some of the controls working in the demo using the online documentation, but noticed it is only given in C#.  While I'm well aware that there are online conversion tools (you have one too), I was hoping Telerik of all companies would buck the ignorant trend of the many .Net sites and treat VB developers as equals.  I mean, we already deal with C# being the default examples on all of the other controls. 

Not trying to get down on Telerik in any way, shape or form.  Just an observation. 

Going back to the WPF documentation, I'm assuming you're still working on it and am hopeful that you'll include documentation for the other 50-60% of the developers out there.  Also, some procedural code examples would be awesome as well.  Currently, there are examples of how th dynamically build the controls that way.

Thanks,
Kurt
Chancel
Top achievements
Rank 1
 answered on 14 May 2014
4 answers
175 views
I have looked for, but not yet found, any predefined RadWindows for File Open, File Save, and File Print dialogs. Do they exist? If not, are there any plans to make them available in a future version of RadWindow?

Please see the post by Manfred Lange

http://msdn.microsoft.com/en-us/library/aa969773.aspx

at MSDN regarding the existing Microsoft common dialog boxes and the problems with them. I think it would be great if Telerik provided a unified set of predefined windows (including File Open Save and Print) for use with RadWindow.

Thanks.

PS: Note that the remarks by Manfred Lange concerning these standard window dialogs are found at the end of that long MSDN article on common dialog windows.
Paul
Top achievements
Rank 1
 answered on 14 May 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?