Telerik Forums
UI for WPF Forum
1 answer
600 views

Hello,

we're currently updating our application to use Telerik components in order to make use of implicit styling.
I'm making good progress so far but am stuck at this one.

We're currently using the Office2019 theme in the Light color variation.
The problem I'm facing is with the selection of a TreeViewItem and the involved change of the Foreground color that goes along with it.

For TreeViewItems that use a string as a header this works just fine. The item i selected, the Background changes to blue and the Foreground to white. Perfetly readable.

However if I use a grid (containing a TextBlock) as the Header the foreground of the TextBlock remains black and does not change to white.

I tried binding the Foreground color of the TextBlock to the Foreground color of the parent TreeViewItem like so:

Binding binding = new Binding("Foreground");
binding.RelativeSource = new RelativeSource(RelativeSourceMode.FindAncestor, typeof(RadTreeViewItem), 1);
tb.SetBinding(TextBlock.ForegroundProperty, binding);

 

However this does not work. Possible because the Foreground property of the TreeViewItem is never changed, but only the Foreground property of the header:

<!-- IsSelected general setters -->
<Trigger Property="IsSelected" Value="True">
    <Setter TargetName="Header" Property="Foreground" Value="{telerik1:Office2019Resource ResourceKey=CheckedForegroundBrush}"/>
    <Setter TargetName="BorderVisual" Property="Background" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(helpers:ThemeHelper.CheckedBrush)}"/>
</Trigger>

 

I tried to add another setter to this trigger and set the Foreground property of the TreeViewItem. This kind of works, but unfortunately propagates through all child items of a TreeViewItem.

Any suggestions on how my desired behaviour could be implemented?

Vladimir Stoyanov
Telerik team
 answered on 08 Dec 2020
1 answer
123 views

If I select Hue Shift and move the slider and have a value of 115.75, then I click on the "Saturation" item and make adjustments via slide to 20.12, now I click on Hue Shift and it's value has reset back to 0.0 even though the "Hue shift" has been applied to the image?

My expectation was the Hue Shift value would be retained NOT reset ... this happens to all the command controls.  Is there a way to prevent the reset of these values when I navigate from command (HueShift) to command (Saturation)?

I noticed your ImageEditor sample application has the same issue ... see video for clarity:

https://youtu.be/ya4a5lMQBdU

Cheers, Rob.

 

Martin Ivanov
Telerik team
 answered on 07 Dec 2020
2 answers
732 views

I am following the documentation from here:

But I would like to use a RadGlyph instead of an image url. Is there a way to use a RadGlyph instead of an image for the IconUrl property in the following class and template? I have not been able to get it to work.

public class MenuItem
{
    public MenuItem()
    {
        this.SubItems = new ObservableCollection<MenuItem>();
    }
 
    public string Text { get; set; }
    public Uri IconUrl { get; set; }
    public bool IsSeparator  { get; set; }
    public ICommand Command { get; set; }
    public ObservableCollection<MenuItem> SubItems { get; set; }
}

 

<Style x:Key="MenuItemStyle" TargetType="telerik:RadMenuItem">
    <Setter Property="Icon" Value="{Binding IconUrl}"/>
    <Setter Property="IconTemplate">
        <Setter.Value>
            <DataTemplate>
                <Image Source="{Binding}" Stretch="None"/>
            </DataTemplate>
        </Setter.Value>
    </Setter>
    <Setter Property="IsSeparator" Value="{Binding IsSeparator}"/>
    <Setter Property="Header" Value="{Binding Text}"/>
    <Setter Property="ItemsSource" Value="{Binding SubItems}"/>
    <Setter Property="Command" Value="{Binding Command}"/>
</Style>

 

Regards,

Don

 

Dilyan Traykov
Telerik team
 answered on 04 Dec 2020
5 answers
724 views

I use the UI for WPF (version 2020.3.1020) with a .NET Core 3.1 application on Windows 10.  I get my Telerik assemblies directly from the Telerik NuGet servers.   This has been working well for about a year.

I tried to upgrade my projects to .NET 5 and it does not compile.  Whereever I use Telerik types, I get build errors like this:

(345,17,345,53): error CA1416: 'SelectionRange<double>' is supported on 'Windows' 7.0 and later
 
(1031,23,1031,31): error CA1416: 'CartesianPlotBandAnnotation.Axis.get' is supported on 'Windows' 7.0 and later

 

I've seen on Telerik's own page that they at least support the .NET 5 Preview

Telerik UI for WPF also provides assemblies for .NET 5.0 Preview (since R2 2020) and .NET 5.0 Release Candidate 1 (RC1) (since R3 2020).

So I'm wondering how I can make my project work with the official .NET 5?  Is this supported yet?



Vladimir Stoyanov
Telerik team
 answered on 04 Dec 2020
2 answers
124 views

Hi,  How do I get the count function to show '0' when there are no rows on the Grid?  

The aggregate functions all seem to disappear when there are no rows.

Thanks,

Richard

 

<telerik:GridViewColumn.AggregateFunctions>
    <telerik:CountFunction ResultFormatString=" {0}" />
</telerik:GridViewColumn.AggregateFunctions>
Richard
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 03 Dec 2020
2 answers
138 views

When I select the Material Theme any image with a RadButton doesn't display.

<telerik:RadButton x:Name="bnApplyTreeScapeSet" Width="28" Height="28" HorizontalAlignment="Left" VerticalAlignment="Center" telerik:RadToolTipService.ToolTipContentTemplate="{x:Null}" telerik:RadToolTipService.InitialShowDelay="100" telerik:RadToolTipService.BetweenShowDelay="0">
    <Image Source="../Resources/save_32.png" Stretch="Uniform" />
    <telerik:RadToolTipService.ToolTipContent>
        <telerik:RadToolTipContentView>
            <TextBlock Text="Apply TreeScape set to Flight Simulator" />
        </telerik:RadToolTipContentView>
    </telerik:RadToolTipService.ToolTipContent>
</telerik:RadButton>

 

My save_32.png doesn't display, non of my Images in any RadButton display.  I've test ALL the other Themes and they work as expected, images display.  This issue is ONLY with Material theme ... which is a shame be cause it's a nice theme.

Thoughts?

Cheers, Rob.

 

Rob A.
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 03 Dec 2020
2 answers
496 views
Hello,

I want to bind some property from my ViewModel to a RadWindow.HeaderTemplate. My approach seems not to work. Can you help me with this?

 
<telerik:RadWindow.HeaderTemplate>
    <DataTemplate>
        <StackPanel Orientation="Horizontal">
            <Image Width="18" Source="Resources/ICO/CANsymEdit.ico" Stretch="Uniform" />
            <!--<ContentPresenter Content="{Binding}" Margin="5,0" />-->
            <TextBlock Text="{Binding DataContext.ActiveDocument, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" VerticalAlignment="Center" Margin="5,0" />
        </StackPanel>
    </DataTemplate>
</telerik:RadWindow.HeaderTemplate>

 

regards,

Tobias

Peter
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 03 Dec 2020
1 answer
211 views

I'm currently using the RadMaskedNumericInput as follows:

<telerik:RadMaskedNumericInput Value="{Binding Value}" Mask="#6.3" SelectionOnFocus="SelectAll" UpdateValueEvent="LostFocus" TextMode="PlainText" IsClearButtonVisible="False" AutoFillZeros="True" HorizontalAlignment="Stretch" Culture="zh-CN" Placeholder=" "  AutoFillNumberGroupSeparators="False" />

As long I'm using german or english keyboard settings, this works as exptected. So if I would type in e.g. "1.23" (either with dot or comma as the decimal seperator), I get the exact same value.

But now one of our chinese customers has informed us, that he isn't able to input the values as exptected. So for testing purposes, I switched the keyboard layout virtually to Chinese (simplified, China) - Microsoft PinYin. This is then things start to get strange: With that, if I click in the control as before and then typing "1.23", I get the odd number "100.010,200" (again same result either for dot or comma).

Does anyone know why this happens and how to avoid this behavior?

Thanks in advance.

Dinko | Tech Support Engineer
Telerik team
 answered on 03 Dec 2020
4 answers
755 views

Hello!

Is it possible to change the titelbar background color (window titlebar) to the Office 2016 theme accent color?

Martin Ivanov
Telerik team
 answered on 03 Dec 2020
4 answers
323 views

<telerik:RadGridView   ItemsSource  ="{Binding ResultList}"
                                     rad:GridViewSelectionUtilities.SelectedItems = "{Binding ResultItems}"
                                     Margin="10,5"
                                     GroupRenderMode ="Flat"
                                     HorizontalAlignment="Left"
                                     AutoGenerateColumns="False"
                                     ShowColumnHeaders="True"
                                     RowDetailsVisibilityMode="Visible"
                                     ShowGroupFooters="False"
                                     ShowGroupPanel="False"
                                     RowIndicatorVisibility="Collapsed" 
                                     EnableColumnVirtualization="True"
                                     EnableRowVirtualization="True"
                                     VirtualizingPanel.IsVirtualizing="True"
                                     ScrollViewer.HorizontalScrollBarVisibility ="Auto"
                                     ScrollViewer.VerticalScrollBarVisibility ="Visible"
                                     FrozenColumnsSplitterVisibility="Collapsed" 
                                     IsFilteringAllowed="False"
                                     IsReadOnly="True"
                                     AutoExpandGroups="False"
                                     ShowSearchPanel="True"
                                     SearchPanelCloseButtonVisibility="Collapsed"
                                     SelectionMode="Extended"
                                     SelectionUnit="FullRow"
                                     >
                   
                    <telerik:RadGridView.GroupHeaderTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <CheckBox rad:GridViewGroupCheckUtilities.IsEnabled="True" IsThreeState="True" />
                            </StackPanel>
                        </DataTemplate>
                    </telerik:RadGridView.GroupHeaderTemplate>

                    <telerik:RadGridView.GroupDescriptors>
                        <telerik:GroupDescriptor Member="CategoryName"
                                                 SortDirection="Ascending">
                            <telerik:GroupDescriptor.AggregateFunctions>
                                <telerik:CountFunction />
                            </telerik:GroupDescriptor.AggregateFunctions>
                        </telerik:GroupDescriptor>
                    </telerik:RadGridView.GroupDescriptors>

.....

</telerik:RadGridView>

 

Hi. Guys.

I used the selectedItems, GroupHeaderTemplete using SDK Sample Browser provided by you.

I use Group Selection in the SDK sample list, but I want to change it to GroupDescriptors display Name, but it doesn't change.

Please check the image. Thx.

 

 

 

Psyduck
Top achievements
Rank 5
Bronze
Bronze
Bronze
 answered on 03 Dec 2020
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?