Telerik Forums
UI for WPF Forum
1 answer
13 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
6 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
7 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
8 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
6 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
0 answers
6 views

i have a combo box that i need when i select one of it's items, it will open a new sub combo box to choose a sub item

 

is it feasible?

Wael
Top achievements
Rank 1
Iron
 asked on 07 May 2024
0 answers
6 views

The Telerik WPF ScheduleView's appointment cells have a problem with intersecting times when assigning schedules within a one-minute timeframe. For example, when I drag and drop to assign a schedule like 12:30 PM - 1:30 PM, and then another schedule from 1:30 PM - 2:30 PM, sometimes it displays two cells in one column (as shown in the right corner), while other times it functions correctly (as shown in the left corner).

I must emphasize that this is a bug in the user interface. Is there a way you can address and fix this issue? Thank you!

Bryan
Top achievements
Rank 1
 asked on 06 May 2024
1 answer
10 views
I have found this documentation online in order to extract and modify the default template style for telerik controls.

https://docs.telerik.com/devtools/wpf/controls/radrichtextbox/styles-and-templates/styling-radrichtextbox#:~:text=To%20copy%20the%20default%20style%2C%20load%20your%20project%20in%20Expression,Style%20%2D%3E%20Edit%20a%20Copy.

I've done this many times on standard WPF controls so I am familiar with the process. When I open project, I get the below options. There is no option to edit style and edit a copy.



Object -> Edit Style -> Edit a Copy.

Martin Ivanov
Telerik team
 answered on 06 May 2024
0 answers
7 views

The Telerik WPF ScheduleView's appointment cell has a problem with intersecting times when assigning schedules within a one-minute time frame. When I drag and drop to assign a schedule, such as from 12:30pm to 1:30pm, and then another schedule from 1:30pm to 2:30pm, sometimes it displays two cells in one column (as shown in the right corner), while other times it works fine (as shown in the left corner).

I must emphasize that this is a bug in the user interface. Is there a way you can fix this issue? Thank you!

Bryan
Top achievements
Rank 1
 asked on 04 May 2024
1 answer
10 views

Hi

In the image attached there are two columns of a radgridview, defined as follow:

<t:GridViewDataColumn										
				Header="{DynamicResource ResourceKey={x:Static r:ResourcesKeys.SelectedColumnHeader }}"
				DataMemberBinding="{Binding IsSelected, Mode=TwoWay
								, UpdateSourceTrigger=PropertyChanged}">
				<t:GridViewDataColumn.CellTemplate>
								<DataTemplate>
									<CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay
										, UpdateSourceTrigger=PropertyChanged}" />
								</DataTemplate>
				</t:GridViewDataColumn.CellTemplate>
</t:GridViewDataColumn>
<t:GridViewCheckBoxColumn
				AutoSelectOnEdit="True"
				Header="{DynamicResource ResourceKey={x:Static r:ResourcesKeys.SelectedColumnHeader }}"
				DataMemberBinding="{Binding IsSelected, Mode=TwoWay
				, UpdateSourceTrigger=PropertyChanged}"/>
As you can see the 2 checkbox have different style: is possible to get the first one with the style of second one?

I need to use the first way, because I need to reflect the checking immediately, while the GridViewCheckBoxColumn seems to works only on lost focus.

Thank you
Luigi
Stenly
Telerik team
 answered on 03 May 2024
Narrow your results
Selected tags
Tags
+? more
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?