Telerik Forums
UI for WPF Forum
0 answers
14 views
When the RadDocking control is added, the window will blank for a moment and then display normally
Telerik
Top achievements
Rank 1
 updated question on 16 May 2024
0 answers
12 views
I am trying to customize the style of a RadRichTextBox. Previously with the standard RichTextBox you could target Textbox base and do a datatrigger to bind to IsKeyboard focused in XAML to change the background if the user had clicked inside the richtextbox to insert or type.

Does the RadRichTextBox have something similar? How can I check to see if it is selected?
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
 asked on 15 May 2024
1 answer
19 views

Hi, I followed the steps on how to save / load filters on my c# WPF app from this link and it is working correctly

https://docs.telerik.com/devtools/wpf/controls/radgridview/filtering/how-to/howto-save-and-load-filter-settings

My grid is filtered and it works for all the columns (Just in case it wasn’t clear, the grid is indeed filtered by Source and Order Id). For all the fields that are strings, the filters look good when it shows:

But the fields that are enums, The header shows the icon as if a filter has been applied, but when it shows me the list, the values are not checked:


Code:

<telerik:RadGridView 
    x:Name="DesignQueueOrderGridView"
    ShowGroupPanel="False" 
    AutoGenerateColumns="False" 
    ItemsSource="{Binding FilteredDesignQueueOrderViewModels}"
    RowDetailsVisibilityMode="Visible"
    RowIndicatorVisibility="Collapsed"
    Grid.Row="1"
    VerticalAlignment="Top"
    RowStyle="{StaticResource RowStyleOdd}" 
    AlternationCount="2" 
    AlternateRowStyle="{StaticResource RowStyleEven}"
    CanUserSortColumns="False">

 

<telerik:GridViewDataColumn 
        UniqueName="ImageSource"
        Header="Source"
        HeaderTextAlignment="Center"
        DataMemberBinding="{Binding ImageSource}"
        IsReadOnly="True">

<telerik:GridViewDataColumn DataMemberBinding="{Binding UserId}" UniqueName="UserId"

                

                            HeaderTextAlignment="Center" 
                            Header="User Id" 
                            IsReadOnly="True"/>

              </telerik:GridViewDataColumn>

Enum:

[DataContract]
public enum ImageSource
{
    [EnumMember]
    Unknown = 0,

    [EnumMember]
    OnlineDesigner = 1

}

public void LoadColumnFilters(IList<FilterSetting> savedSettings)
{
    Application.Current.Dispatcher.Invoke(() =>
    {
        GridViewDataControl.FilterDescriptors.SuspendNotifications();

        foreach (FilterSetting setting in savedSettings)
        {
            Telerik.Windows.Controls.GridViewColumn column = GridViewDataControl.Columns[setting.ColumnUniqueName];

            if (column is null)
                continue;

            IColumnFilterDescriptor columnFilter = column.ColumnFilterDescriptor;

            if (setting.SelectedDistinctValues is not null)
            {
                foreach (string? distinctValue in setting.SelectedDistinctValues)
                {
                    columnFilter.DistinctFilter.AddDistinctValue(distinctValue);
                }
            }
        }

        GridViewDataControl.FilterDescriptors.ResumeNotifications();
    });
}

 

Thank you in advance! Juan

Martin Ivanov
Telerik team
 answered on 13 May 2024
0 answers
17 views

Hi.

Is it possible to have a RadGridView with Grouping, Virtualization and still have Content based scrolling (CanContentScrol=true)?

We have a rather big List of Items with unequal height. The List is dynamically managed based on the state of an external peripheral. List Items are added or removed when the state of the peripheral changes. This leads to unwanted movement of the Items in the List.

We are trying to encounter Item movement when the List changes. We implemented a solution similar to this one: Keep Selected Item in Viewport when Collection Changes - Telerik UI for WPF 

But when enabling Grouping or Sorting, the RadGridView seems to change to pixel based scrolling instead of Item based scrolling. Then it seems the above solution is not working anymore, because the Offset then needs to be given in Pixels instead of Items.

Is it possible to have Item based scrolling despite Grouping or Sorting?

Else is it possible to get the height of the inserted/removed Item to calculate the offset needed, even if Virtualization is enabled?

Or is possibly some other approach better suited?

Johannes
Top achievements
Rank 1
 asked on 13 May 2024
0 answers
24 views

In the HtmlExportSettings there is no valid ImageExportMode that word is compatible with as it is not able to display Base64 encoded images.

Is there another ImageExportMode that is compatible?

OR

Is there a better solution to insert images from RichTextBox into a Microsoft word document? Possibly, create RadDocument from the word document I have and replace it in the RadDocument and do conversion to Microsoft word document?

Open to suggestions.

Patrick
Top achievements
Rank 1
Iron
Iron
Iron
 asked on 10 May 2024
1 answer
25 views
Hi , I'm trying to automate the testing of a WPF program by writing code. I can perform actions on the main window of the program, but I can't do it on a different window. I think the reason for this is that it doesn't recognize that window. However, I couldn't find out how to switch to a different window.Can you help me ?. Here's an example of the code I've written:
        [CodedStep(@"Type 'XXX' into ServerNameWatermarkTextbox")]
        public void ConfirmInstalledDate_CodedStep()
        {
            string formattedDate = DateTime.Now.ToString("yyyy-MM-dd");
            ActiveApplication.MainWindow.Find.ByName("serverNameWatermark").User.TypeText("XXX",2);
            ActiveApplication.MainWindow.Find.ByName("usernameWaterMark").User.TypeText("logadmin",2);         
            ActiveApplication.MainWindow.Find.ByName("usernameWaterMark").KeyPress(ArtOfTest.WebAii.Win32.KeyBoard.KeysFromString("Tab"),1,1,1);
            ActiveApplication.MainWindow.Find.ByName("pwdBox").User.TypeText("XXX",2);
            ActiveApplication.MainWindow.Find.ByName<Button>("btnSignIn").User.Click();
            System.Threading.Thread.Sleep(5000);
            ActiveApplication.MainWindow.Find.ByName("imgData").User.Click();
            ActiveApplication.MainWindow.Find.ByTextContent("Status").User.Click(MouseClickType.RightClick);
            ActiveApplication.MainWindow.Find.ByTextContent("Select columns").User.Click();
            ActiveApplication.GetWindow("Select columns");
            ActiveApplication.GetWindow("Select columns").Find.ByName("txtSearch").User.TypeText("Date",2); 
            System.Threading.Thread.Sleep(5000);
            ActiveApplication.GetWindow("Select columns").Find.ByName("txtSearch").User.KeyPress(System.Windows.Forms.Keys.Enter,1);
            ActiveApplication.MainWindow.Find.ByTextContent("^"+formattedDate).User.Click();
            System.Threading.Thread.Sleep(2000);
        }
    }
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 10 May 2024
0 answers
10 views
How can I bind a property to RadRichTextBox FontSize and FontFamily? I get errors saying the property types don't match but they do. FontSize property is double and FontFamily property type is FontFamily. Any ideas?
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
 asked on 10 May 2024
1 answer
13 views

Hello,

I would like to add a slide button under the tile view like screenshot.

How can I add a button under the tile view?

Thanks for your feedback.

Martin Ivanov
Telerik team
 answered on 10 May 2024
1 answer
25 views
I have a simple NumericUpDown control showing milliseconds.  I use a 'ms' custom unit to show alongside the number. 

<tk:RadNumericUpDown  Width="150"  Height="50"
    Value="{Binding Exposure}"
    IsInteger="True"
    CustomUnit="ms"/>

It looks good but as soon as hit the + or - key, the 'ms' disappears and I have just a number.  This is because hitting +/- gives keyboard focus to the edit box -- activates the cursor in there and all that.    Once I click somewhere else focus leaves the edit box, the 'ms' re-appears.

Is there a property or some simple way that would let me prevent this behavior?   I want +/- to just change the number without grabbing the keyboard focus.  

Note that I do still want the number to be user-editable if they actually go to the trouble of clicking directly in the edit box itself.  I just want to stop +/- from doing that for me.
Dimitar
Telerik team
 answered on 09 May 2024
0 answers
12 views

ChartView experiences frequent garbage collection in TrackInfoUpdated after Tooltip of any control is activated.

    <Grid Loaded="Grid_Loaded">
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel>
            <TextBlock x:Name="DTextBlock"></TextBlock>
            <StackPanel Width="200" Height="25" ToolTip="SSSS" Background="Red"></StackPanel>
        </StackPanel>
        <telerik:RadCartesianChart Grid.Row="1" x:Name="DMainChart">
            <telerik:RadCartesianChart.HorizontalAxis>
                <telerik:DateTimeCategoricalAxis MajorTickInterval="30" LineStroke="Transparent">
                </telerik:DateTimeCategoricalAxis>
            </telerik:RadCartesianChart.HorizontalAxis>
            <telerik:RadCartesianChart.VerticalAxis>
                <telerik:LinearAxis />
            </telerik:RadCartesianChart.VerticalAxis>
            <telerik:RadCartesianChart.Series>
                <telerik:LineSeries x:Name="DLineSeries" CategoryBinding="Seq" ValueBinding="Open"></telerik:LineSeries>
            </telerik:RadCartesianChart.Series>
            <telerik:RadCartesianChart.Behaviors>
                <telerik:ChartPanAndZoomBehavior ZoomMode="Horizontal" DragMode="Pan"/>
                <telerik:ChartTrackBallBehavior ShowIntersectionPoints="False" ShowTrackInfo="False" TrackInfoUpdated="ChartTrackBallBehavior_TrackInfoUpdated"/>
            </telerik:RadCartesianChart.Behaviors>
        </telerik:RadCartesianChart>
    </Grid>

        private void Grid_Loaded(object sender, RoutedEventArgs e)
        {
            if (sender is Grid grid)
            {
                grid.DataContext = this;
                ObservableCollection<SeriesKLineModel> ChartKLine = new ObservableCollection<SeriesKLineModel>();
                Random random = new Random();
                for (int i = 0; i < 5000; i++)
                {
                    SeriesKLineModel mode = new SeriesKLineModel(DateTime.Now.AddDays(i), random.Next(10, 20), 5, -5, 0, Color.FromRgb(33, 141, 252));
                    mode.Seq = mode.Seq.AddHours((-1) * i);
                    ChartKLine.Add(mode);
                }
                this.DLineSeries.ItemsSource = ChartKLine;
                this.DTextBlock.SetBinding(TextBlock.TextProperty, new Binding(nameof(TestText)));
            }
        }
        private string _TestText = "";
        public event PropertyChangedEventHandler PropertyChanged;
        public string TestText
        {
            get
            {
                return _TestText;
            }
            set
            {
                _TestText = value;
                this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(TestText)));
            }
        }

        private void ChartTrackBallBehavior_TrackInfoUpdated(object sender, Telerik.Windows.Controls.ChartView.TrackBallInfoEventArgs e)
        {
            DataPointInfo pointInfo = e.Context?.ClosestDataPoint;
            if (pointInfo != null && pointInfo.DataPoint.DataItem is SeriesKLineModel data)
            {
                string str = data.Seq.ToLongDateString();
                Task.Run(() =>
                {
                    this.TestText = str;
                });
            }
        }
力源
Top achievements
Rank 1
 asked on 08 May 2024
Narrow your results
Selected tags
Tags
+? more
Top users last month
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
MIS
Top achievements
Rank 1
Ross
Top achievements
Rank 1
Marcin
Top achievements
Rank 1
Iron
Iron
Sean
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
MIS
Top achievements
Rank 1
Ross
Top achievements
Rank 1
Marcin
Top achievements
Rank 1
Iron
Iron
Sean
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?