Telerik Forums
UI for WPF Forum
1 answer
78 views

We would like to change the color of the highlighted items (i.e., HighlightedItemsSource) in the RadGanttView.

I know this is possible by copying and customizing the ControlTemplate, but I would like to avoid that if possible since I would need to do that for all the different types of containers.

I also know it's possible to change the color in the theme (we're using Office2019), but unfortunately, the template uses ValidationBrush for these highlights and we still want the validation to show as red in other areas of our application.

Is there any other way to change the color of the highlighted items?

Stenly
Telerik team
 answered on 26 Mar 2024
1 answer
108 views

If I have set the Angle Range on a RadPieChart so that I have a semicircle, is there a good way to make the remaining chart take up the entire area used for the RadPieChart or at least a good way to center it?


<telerik:RadPieChart x:Name="Chart" Background="Yellow">

    <telerik:RadPieChart.Series>

        <telerik:DoughnutSeries x:Name="DonutSeries" ShowLabels="False">

            <telerik:DoughnutSeries.DataPoints>
                <telerik:PieDataPoint Label="TestLabel1" Value="15"/>
                <telerik:PieDataPoint Label="TestLabel2" Value="50"/>
            </telerik:DoughnutSeries.DataPoints>

            <telerik:DoughnutSeries.LegendSettings>
                <telerik:DataPointLegendSettings TitleBinding="Label"/>
            </telerik:DoughnutSeries.LegendSettings>

            <telerik:DoughnutSeries.AngleRange>
                <telerik:AngleRange StartAngle="180" SweepAngle="180" SweepDirection="Clockwise"/>
            </telerik:DoughnutSeries.AngleRange>

        </telerik:DoughnutSeries>


    </telerik:RadPieChart.Series>
</telerik:RadPieChart>

 

Thank You!

Dimitar
Telerik team
 answered on 25 Mar 2024
1 answer
76 views

Hello,

I'm using a RadMaskedTextInput and I'm wondering if it's possible to change the foreground color of just the placeholders?

What I'm trying to accomplish is for every X in below image to appear in a brighter color than the text typed in by the user.

What my RadMaskedTextInput looks like currently:

What I want the foreground to look like:

Stenly
Telerik team
 answered on 25 Mar 2024
2 answers
143 views

Is there a way to use RadGlyphs as icons for the items of a RadBreadcrumb?

Thank you.

Wizard6650
Top achievements
Rank 1
Iron
Iron
 updated answer on 25 Mar 2024
0 answers
107 views

Hi,

I am trying to change the theme through telerik StyleManager.Theme.

Not apply :

 <mynumeric:MyNumeric x:Name="TEST" Margin="-2,0,0,0"
                  Value="{Binding ViewModel.SerialNumber,Mode=TwoWay}" 
                   ValueFormat="Numeric"
                   NumberDecimalDigits="0"
                   Minimum="1" Maximum="9999"
                   telerik:StyleManager.Theme="{Binding Path=(mainwindowviewmodel:MainWindowViewModel.CurrentTheme),Converter={StaticResource ThemeToTelerikThemeConverter}}"
                   IsReadOnly="{Binding Path=(mainwindowviewmodel:MainWindowViewModel.IsManagerAccess),Converter={StaticResource InverseBooleanConverter}}"
                   >

Apply :

 <telerik:RadNumericUpDown x:Name="TEST" Margin="-2,0,0,0"
                  Value="{Binding ViewModel.SerialNumber,Mode=TwoWay}" 
                   ValueFormat="Numeric"
                   NumberDecimalDigits="0"
                   Minimum="1" Maximum="9999"
                   telerik:StyleManager.Theme="{Binding Path=(mainwindowviewmodel:MainWindowViewModel.CurrentTheme),Converter={StaticResource ThemeToTelerikThemeConverter}}"
                   IsReadOnly="{Binding Path=(mainwindowviewmodel:MainWindowViewModel.IsManagerAccess),Converter={StaticResource InverseBooleanConverter}}"
                   >

public class MyNumeric : RadNumericUpDown
{
    public override string FormatDisplay()
    {
        if (this.Value.HasValue)
        {
            return this.Value.Value.ToString("0000");
        }
        return base.FormatDisplay();
    }

    public override string FormatEdit()
    {
        if (this.Value.HasValue)
        {
            return this.Value.Value.ToString("0000");
        }
        return base.FormatEdit();
    }
}

internal class ThemeToTelerikThemeConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        if (!Enum.IsDefined(typeof(Wpf.Ui.Appearance.ThemeType), value))
            throw new ArgumentException("ExceptionEnumToBooleanConverterValueMustBeAnEnum");

        switch (value)
        {
            case Wpf.Ui.Appearance.ThemeType.Light:
                return "Office2019";
            case Wpf.Ui.Appearance.ThemeType.Dark:
                return "Expression_Dark";

            default:
                return "Office2019";
        }
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        throw new NotImplementedException();
    }
}

I'll appreciate any help.

 

Dooly
Top achievements
Rank 1
Iron
 asked on 25 Mar 2024
1 answer
68 views

Hello,

            I want to update the node and connector after giving the GraphDatasource in the "RadDiagram", 

           Because I want to used different nodes and different style connectors together in diagram.

            

 

Martin Ivanov
Telerik team
 answered on 22 Mar 2024
1 answer
94 views

I have to scrub pasted fragments from web sources to remove any hyperlinks in those fragments but keep the text associated with the link if any.  I have tried the following code which gets the proper hyperlink elements, but this is not removing the hyperlink info.   Please let me know the proper method of finding all hyperlinks in the pasted document content and removing those links.  Thanks.


            var richTextBox = new RadRichTextBox();
            richTextBox.InsertFragment(document.Selection.CopySelectedDocumentElements());
            richTextBox.Document.Selection.SelectAll();

            var boxes = richTextBox.Document.Selection.GetSelectedBoxes().Where(b => b.AssociatedInline.FieldStart != null && b.AssociatedInline.FieldStart.GetType() == typeof(HyperlinkRangeStart));
            foreach (var box in boxes)
            {
                richTextBox.Document.CaretPosition.MoveToInline(box.AssociatedInline);
                richTextBox.RemoveHyperlink();
            }

Dimitar
Telerik team
 answered on 22 Mar 2024
2 answers
87 views

My application utilizes the RadDocking control to manage layout, including a RadPane that hosts a CefSharp browser. I've observed that when this pane is docked and I reset the layout, everything functions as expected - the layout resets and the browser remains responsive. However, if I float the pane (detach it so it becomes a window) and then reset the layout, the browser within the pane freezes and becomes unresponsive.

Here's a simplified snippet of how the RadPane and browser are set up:

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="0.2*"/>
        </Grid.RowDefinitions>
        <telerik:RadDocking x:Name="radDocking" HasDocumentHost="False" SerializationTag="Docking">
            <telerik:RadSplitContainer telerik:RadDocking.SerializationTag="S1">
                <telerik:RadPaneGroup x:Name="RadPaneGroup1" telerik:RadDocking.SerializationTag="G1">
                    <telerik:RadPane x:Name="RadPane1" telerik:RadDocking.SerializationTag="P1">
                        <TextBlock Text="Pane 1"/>
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
            <telerik:RadSplitContainer telerik:RadDocking.SerializationTag="S2">
                <telerik:RadPaneGroup x:Name="RadPaneGroup2" telerik:RadDocking.SerializationTag="G2">
                    <telerik:RadPane x:Name="RadPane2" telerik:RadDocking.SerializationTag="P2">
                        <wpf:ChromiumWebBrowser Name="Browser" Initialized="Browser_OnInitialized"/>
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
        </telerik:RadDocking>
        <Button Grid.Row="1" Content="Reset Layout" Click="ResetLayout_Click"/>
    </Grid>

 public partial class MainWindow
 {
     public MainWindow()
     {
         InitializeComponent();
         SaveLayout();
     }
     
     private void Browser_OnInitialized(object sender, EventArgs e)
     {
         string videoUrl = "https://www.youtube.com/embed/JrNMyzsYr4M?autoplay=1&mute=1";

         string html = $@"
         <html>
             <head>
                 <meta charset='utf-8'>
             </head>
             <body style='margin:0; padding:0;'>
                 <iframe width='100%' height='100%' src='{videoUrl}' frameborder='0' allow='autoplay; encrypted-media' allowfullscreen></iframe>
             </body>
         </html>
         ";

         Browser.LoadHtml(html, "http://dummy.com");
     }

     private void SaveLayout()
     {
         using (IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForAssembly())
         {
             using (var isoStream = storage.OpenFile("RadDocking_Layout.xml", FileMode.Create))
             {
                 radDocking.SaveLayout(isoStream);
                 isoStream.Seek(0, SeekOrigin.Begin);
                 StreamReader reader = new StreamReader(isoStream);
                 reader.ReadToEnd();
             }
         }
     }

     private void ResetLayout_Click(object sender, RoutedEventArgs e)
     {
         using (IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForAssembly())
         {
             using (var isoStream = storage.OpenFile("RadDocking_Layout.xml", FileMode.Open))
             {
                 radDocking.LoadLayout(isoStream);
             }
         }
     }
 }

 

The primary question I have is: Why does the browser freeze only when the pane is floating and I reset the layout, and how can I prevent this without resorting to programmatically docking the pane before the reset?

 

Thanks.

Ohad
Top achievements
Rank 3
Bronze
Iron
Iron
 updated answer on 21 Mar 2024
1 answer
58 views

Hi.

I am trying to customize my month view for my special slots.

I can do it for daily and weekly, but for monthly it takes the whole slot. I want it to look like the appointments do... (i.e.: show the stack of slots if there are more than one...)

What am I doing wrong? Or cannot be done...

 

I am using Telerik UI for WPF R1 2023

 

Thanks in advance!

Stenly
Telerik team
 answered on 21 Mar 2024
0 answers
63 views

Hi,

Editor.Document.CurrentSnapshot.GetText() returns the current text where new lines are \n characters rather than the usual \r\n.

Is there a specific reason for this behavior? Is it possible to act on some parameter to restore the usual behavior?

 

Thanks,

marc.

Marcello
Top achievements
Rank 1
Iron
 asked on 20 Mar 2024
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?