Telerik Forums
UI for WPF Forum
2 answers
232 views

Hi,

I am quite new to Telerik and I am trying to set up automated tests for our WPF application. Whenever I try to use 'bar.User.TypeText("SomeText", 200)' to a framework element (found using 'FrameworkElement bar= foo.MainWindow.Find.ByAutomationId("New_Proj_Text_Box");') it sends a couple of letters to the TextBox, but then it cuts stops sending text.

 

I think that this may be something to do with the window loading as the TextBox is in a Modal window and when you open the modal window mmanually (rather than using the link via Telerik) SendText sends all the text to to the TextBox.

 

I have tried to introduce an "ensureClickable", changed the times for the "keyPressTime" and changing the clickFirst argument (trying both True and False). Unfortunately none of these seem to work.

 

I have placed my test below. Unfortunately there are no helpful errors in the logs.

 

Any help on this would be hugely appreciated.

 

Many thanks in advance,

 

David

 

 

using ArtOfTest.WebAii.Controls.Xaml.Wpf;
using ArtOfTest.WebAii.Core;
using ArtOfTest.WebAii.Silverlight;
using ArtOfTest.WebAii.TestTemplates;
using ArtOfTest.WebAii.Wpf;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace UnitTestProject2
{
    /// <summary>
    /// Summary description for TelerikNUnitTest1
    /// </summary>
    [TestClass]
    public class TelerikNUnitTest1 : BaseWpfTest
    {

        private TestContext testContextInstance;

        public WpfApplication foo { get; private set; }

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>

        [TestMethod]
        public void Open_Application()
        {
            
            Settings mySettings = new Settings();
            mySettings.ClientReadyTimeout = 60000;

            /// Use my Settings object to construct my Manager object
            Manager myManager = new Manager(mySettings);
            myManager.Start();

            // Launch the application instance from its location in file system
            WpfApplication fubar = myManager.LaunchNewApplication(@"C:\Users\e-ddcr\Documents\appLocation\Fubar.Startup.exe");

            /// Validate the title of the homepage
            ArtOfTest.Common.UnitTesting.Assert.IsTrue(fubar.MainWindow.Window.Caption.Equals("MainWindow"));
            //TestContext.WriteLine("Validated window");

            ///Click the new project button
            FrameworkElement newProjButton = fubar.MainWindow.Find.ByTextContent("New project...");
            newProjButton.User.Click();

            ///Send keys to the project name textbox
            FrameworkElement projNameTextBox = fubar.MainWindow.Find.ByAutomationId("New_Proj_Text_Box");
            projNameTextBox.EnsureClickable();
            projNameTextBox.User.Click();
            projNameTextBox.User.TypeText("PokeMoon", 100);
                 
        }

    }

}

Georgi
Telerik team
 answered on 21 Sep 2016
2 answers
142 views

Hello.

I discovered that styling empty table cells works while editing, but the formatting is lost when the RadDocument is converted to RTF format and back again.       
I have created Test() method to demonstrate a simple conversion that does not work.

in EditControl.xaml.cs

private void Test()
{
      var provider = new RtfFormatProvider();
          var rtfString = provider.Export(_radRichTextBox.Document);     
          _radRichTextBox.Document = provider.Import(rtfString);
}

in EditControl.xaml

<telerik:RadRichTextBox x:Name="_radRichTextBox" />

 

Attached is a 3 step process outlining how this is breaking for me. Thanks for the help.

Nathanial
Top achievements
Rank 1
 answered on 21 Sep 2016
3 answers
294 views

Hi,

i need to create PDF bookmarks programmatically and using RadDocument model api instead of RadDocumentEditor. 

My code looks like this:

// Create section with header, footer and two paragraphs.     
Section section = new Section();
 
// Create bookmark.
var titleSpan = new Span(title);
BookmarkRangeStart start = new BookmarkRangeStart(title);
BookmarkRangeEnd end = new BookmarkRangeEnd();
start.End = end;
end.Start = start;
 
Paragraph headingParagraph = new Paragraph() { StyleName = "Heading1" };
 
// Insert inlines.
headingParagraph.Inlines.Add(start);
headingParagraph.Inlines.Add(titleSpan);
headingParagraph.Inlines.Add(end);
 
section.Blocks.Add(headingParagraph);
 
this.radDocument.Sections.Add(section );

 

but when I open document in AdobeReader there aren't any bookmarks.

What's wrong with this code?

Thank you.

Tanya
Telerik team
 answered on 21 Sep 2016
6 answers
325 views

I'm trying to use RadGridView with VirtualQueryableCollectionView  to display data from database.

The data is very large and it's growing in real time, let's say there are more than 25 rows will be added into database every second. And I want to refresh RadGridView to show real time data.

 

How can I do that? Is there any example?

 

Thanks very much!

 

 

Stefan Nenchev
Telerik team
 answered on 21 Sep 2016
3 answers
291 views

Hi, 

   Iam new to RadPropertyGrid. I want to use Custom Editor which can be used from propertygrid as modal dialog similar to UITYPE editor inherited class in Winforms or  "ITypeEditor" in Xceed WPF related property Grid.

Is there any similar support from telerik side for similar requirement??

 

Regards,

Nagasree.

Dilyan Traykov
Telerik team
 answered on 21 Sep 2016
1 answer
174 views
How does one respond to the user (not a binding or background setting of the rating) setting a rating? I can't find any event that fires ONLY when the user selects a rating and I would have assumed this is a pretty standard requirement.
Petar Marchev
Telerik team
 answered on 21 Sep 2016
1 answer
133 views

i m developing a window application. In which i m using the map control of WPF control, i want to access the map which is deployed in my own map server(i m using openstreetmap) and my system is connected with that server via LAN. 

How can i add this Map in the map control.Please help

 

Thanks for advance.

Petar Mladenov
Telerik team
 answered on 21 Sep 2016
6 answers
207 views

I'm just update to 2016 R3 and apply Office2016 Theme,

when I run project it's all ok, but in design mode I don't see controls.

WE a passed from Office2013 theme to Office2016 them, I have to change something?

Stef
Telerik team
 answered on 20 Sep 2016
1 answer
249 views

Hello,

I have a scenario with RadGridView where I want to display the value of a continuously changing data point (eg DateTime.Now) in one of the columns. I want the UI to be refreshed with the latest value periodically (once every second for example).

My current solution is to periodically iterate through each item the ItemsSource and fire INotifyPropertyChanged event for the particular property that requires refresh. This works but there is a noticeable performance impact on the UI thread when the values are updated.

My question is, does RadGridView have any support for updating an entire column on a periodic timer, rather than me having to iterate through all the rows and notify manually? If not can such support be added in the future?

Stefan
Telerik team
 answered on 20 Sep 2016
4 answers
2.2K+ views
In my application I have a RadGridView and a Data Form. If I change the group or type of the DocumentTitle on the CombBox in Data Form, I get the following error message:

"The property 'Id' is part of the object's key information and cannot be modified."

XAML-Code (DataGrid):

01.<telerik:RadEntityFrameworkDataSource Name="DocumentTitlesDataSource" QueryName="DocumentTitles">
02. </telerik:RadEntityFrameworkDataSource>
03.  
04.            <telerik:RadGridView x:Name="Entries" Grid.Row="1"
05.                             ItemsSource="{Binding DataView, ElementName=DocumentTitlesDataSource}"
06.                             SelectedItem="{Binding DataView.CurrentItem, Mode=OneWay, ElementName=DocumentTitlesDataSource}"
07.                             SelectionMode="Single"
08.                             IsReadOnly="True"
09.                             AutoGenerateColumns="False"
10.                             IsSynchronizedWithCurrentItem="True"
11.                             CanUserDeleteRows="False"
12.                             CanUserFreezeColumns="False"
13.                             CanUserInsertRows="False"
14.                             CanUserReorderColumns="False"
15.                             CanUserResizeColumns="False"
16.                             CanUserSortColumns="False"
17.                             CanUserSortGroups="False"
18.                             IsFilteringAllowed="False"
19.                             ShowGroupPanel="False"
20.                             ShowColumnHeaders="False" SelectionChanging="Entries_SelectionChanging">
21.                <telerik:RadGridView.Columns>
22.                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Id}" Header="Id" Width="20" IsVisible="False"/>
23.                    <telerik:GridViewDataColumn DataMemberBinding="{Binding User.Id}" Header="Benutzer" Width="10" IsVisible="False"/>
24.                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Computer}" Header="Computer" Width="10" IsVisible="False"/>
25.                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Dokumententitel" Width="*"/>
26.                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Group.Id}" Header="Dokumentengruppe" Width="200"/>
27.                    <telerik:GridViewComboBoxColumn x:Name="cbxDocumentTitleGroup" DataMemberBinding="{Binding Group.Id}"
28.                                                    DisplayMemberPath="Name"
29.                                                    SelectedValueMemberPath="Id"
30.                                                    Header="Dokumentengruppe"
31.                                                    Width="100"/>
32.                    <telerik:GridViewComboBoxColumn x:Name="cbxDocumentTitleType" DataMemberBinding="{Binding Type.Id}"
33.                                                    DisplayMemberPath="Name"
34.                                                    SelectedValueMemberPath="Id"
35.                                                    Header="Dokumententyp"
36.                                                    Width="100" />
37.                    <telerik:GridViewDataColumn DataMemberBinding="{Binding System}" Header="System" Width="10" IsVisible="False"/>
38.                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Locked}" Header="Gesperrt" Width="10" IsVisible="False"/>
39.                </telerik:RadGridView.Columns>
40.            </telerik:RadGridView>

XAML-Code (DataForm):

01.<Grid.Resources> 
02.                <DataTemplate x:Key="WriteTemplate">
03.                    <Grid>
04.                        <Grid.ColumnDefinitions>
05.                            <ColumnDefinition Width="150"></ColumnDefinition>
06.                            <ColumnDefinition Width="*"></ColumnDefinition>
07.                        </Grid.ColumnDefinitions>
08.                        <Grid.RowDefinitions>
09.                            <RowDefinition></RowDefinition>
10.                            <RowDefinition></RowDefinition>
11.                            <RowDefinition></RowDefinition>
12.                            <RowDefinition></RowDefinition>
13.                            <RowDefinition></RowDefinition>
14.                        </Grid.RowDefinitions>
15.                        <Label Grid.Row="0" Grid.Column ="0" Margin="0,5,0,0">Dokumententitel:</Label>
16.                        <Label Grid.Row="1" Grid.Column ="0" Margin="0,5,0,0">Dokumentengruppe:</Label>
17.                        <Label Grid.Row="2" Grid.Column ="0" Margin="0,5,0,0">Dokumententyp:</Label>
18.                        <Label Grid.Row="3" Grid.Column ="0" Margin="0,5,0,0">Gesperrt:</Label>
19.                        <Label Grid.Row="4" Grid.Column ="0" Margin="0,5,0,0">Systemeintrag:</Label>
20.                        <telerik:DataFormDataField Grid.Row="0" Grid.Column ="1" DataMemberBinding="{Binding Name , Mode=TwoWay}" HorizontalAlignment="Stretch" LabelPosition="Above" Margin="0,5,0,0"/>
21.                        <telerik:DataFormComboBoxField Grid.Row="1" Grid.Column="1" HorizontalAlignment="Stretch" LabelPosition="Above" Margin="0,5,0,0"
22.                                                       ItemsSource="{Binding ItemsSource, ElementName=cbxDocumentTitleGroup, Mode=TwoWay}"
23.                                                       DataMemberBinding="{Binding Group.Id}"
24.                                                       DisplayMemberPath="Name"
25.                                                       SelectedValuePath="Id"
26.                                                       SelectedIndex="{Binding Group}"/>
27.                        <telerik:DataFormComboBoxField Grid.Row="2" Grid.Column="1" HorizontalAlignment="Stretch" LabelPosition="Above" Margin="0,5,0,0"
28.                                                       ItemsSource="{Binding ItemsSource, ElementName=cbxDocumentTitleType}"
29.                                                       DataMemberBinding="{Binding Type.Id}"
30.                                                       DisplayMemberPath="Name"
31.                                                       SelectedValuePath="Id"
32.                                                       SelectedIndex="{Binding Type}"/>
33.                        <telerik:DataFormCheckBoxField Grid.Row="3" Grid.Column ="1" DataMemberBinding="{Binding Locked , Mode=TwoWay}" HorizontalAlignment="Stretch" LabelPosition="Above" Margin="0,5,0,0"/>
34.                        <telerik:DataFormCheckBoxField Grid.Row="4" Grid.Column ="1" IsReadOnly="True" DataMemberBinding="{Binding System , Mode=TwoWay}" HorizontalAlignment="Stretch" LabelPosition="Above" Margin="0,5,0,0"/>
35.                    </Grid>
36.                </DataTemplate>
37.            </Grid.Resources>   
38. 
39.        <telerik:RadDataForm x:Name="EntryDetails" Grid.Row="2" Header="Dokumententitel"
40.                             CommandButtonsVisibility="Cancel, Commit" AutoGenerateFields="False" AutoCommit="False"
41.                             EditEnding="EntryDetails_EditEnding"  ValidatingItem="EntryDetails_ValidatingItem" EditEnded="EntryDetails_EditEnded"
42.                             ReadOnlyTemplate="{StaticResource ReadTemplate}"
43.                             EditTemplate="{StaticResource WriteTemplate}"
44.                             NewItemTemplate="{StaticResource WriteTemplate}"
45.                             ItemsSource="{Binding DataView, ElementName=DocumentTitlesDataSource}"/>  

C# Code:

01.public DocimpDocumentTitles(VIMANTO.Environment My)
02.        {
03.            InitializeComponent();
04.            my = My;
05.            db.Database.Connection.ConnectionString = my.CurrentConnection.GetSqlConntectionString();
06.            DocumentTitlesDataSource.DbContext = db;
07. 
08.            ObservableCollection<CatalogEntry> documentTitleGroups = new ObservableCollection<CatalogEntry>();
09.            ObservableCollection<CatalogEntry> documentTitleTypes = new ObservableCollection<CatalogEntry>();
10. 
11.            documentTitleGroups = Database.Views.CatalogViews.GetCatalogEntries(my.CurrentConnection, VIMANTO.Database.Views.CatalogViews.GetCatalog(my.CurrentConnection, "Dokumentengruppen").Id, true);
12.            cbxDocumentTitleGroup.ItemsSource = documentTitleGroups;
13. 
14.            documentTitleTypes = Database.Views.CatalogViews.GetCatalogEntries(my.CurrentConnection, VIMANTO.Database.Views.CatalogViews.GetCatalog(my.CurrentConnection, "Dokumententypen").Id, true);
15.            cbxDocumentTitleType.ItemsSource = documentTitleTypes;
16.        }  

 

 

 

 

 

 

 

 

 

 

Dilyan Traykov
Telerik team
 answered on 20 Sep 2016
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
InlineAIAssistant
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?