or
using System;using System.Collections.Generic;using System.ComponentModel;using System.Linq;namespace HOME.Samples.TypeDescriber.Objects{ public class TestResultRowWrapper : Dictionary<string, double?>, ICustomTypeDescriptor { AttributeCollection ICustomTypeDescriptor.GetAttributes() { return new AttributeCollection(null); } string ICustomTypeDescriptor.GetClassName() { return null; } string ICustomTypeDescriptor.GetComponentName() { return null; } TypeConverter ICustomTypeDescriptor.GetConverter() { return null; } EventDescriptor ICustomTypeDescriptor.GetDefaultEvent() { return null; } PropertyDescriptor ICustomTypeDescriptor.GetDefaultProperty() { return null; } object ICustomTypeDescriptor.GetEditor(Type editorBaseType) { return null; } EventDescriptorCollection ICustomTypeDescriptor.GetEvents(Attribute[] attributes) { return new EventDescriptorCollection(null); } EventDescriptorCollection ICustomTypeDescriptor.GetEvents() { return new EventDescriptorCollection(null); } PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[] attributes) { var properties = Keys.Select(key => new TestResultPropertyDescriptor(key)).Cast<PropertyDescriptor>().ToList(); return new PropertyDescriptorCollection(properties.ToArray()); } PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties() { return ((ICustomTypeDescriptor)this).GetProperties(null); } object ICustomTypeDescriptor.GetPropertyOwner(PropertyDescriptor pd) { return this; } }}TestResultPropertyDescriptorusing System;using System.Collections.Generic;using System.ComponentModel;namespace HOME.Samples.TypeDescriber.Objects{ public class TestResultPropertyDescriptor : PropertyDescriptor { public TestResultPropertyDescriptor(string key) : base(key, null) { } public override Type ComponentType { get { return typeof (Dictionary<string, double?>); } } public override bool IsReadOnly { get { return false; } } public override Type PropertyType { get { return typeof (double?); } } public override bool CanResetValue(object component) { return false; } public override object GetValue(object component) { return ((Dictionary<string, double?>) component)[base.Name]; } public override void ResetValue(object component) { ((Dictionary<string, double?>) component)[base.Name] = 0; } public override void SetValue(object component, object value) { ((Dictionary<string, double?>) component)[base.Name] = (double?) value; } public override bool ShouldSerializeValue(object component) { return false; } }}<Window x:Class="HOME.Samples.Client.Wpf.View.MainWindow" Title="MainWindow" Height="350" Width="525" xmlns:ViewModel1="clr-namespace:HOME.Samples.TypeDescriber.ViewModel;assembly=HOME.Samples.TypeDescriber" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" mc:Ignorable="d" d:DataContext="{d:DesignInstance Type=ViewModel1:MainWindowViewModel}"> <Window.Resources> <Style x:Key="amountColumnStyle" TargetType="telerik:GridViewDataColumn"> <Setter Property="FooterCellStyle"> <Setter.Value> <Style TargetType="telerik:GridViewFooterCell"> <Setter Property="FontWeight" Value="Bold"/> <Setter Property="Background" Value="LightGray"/> </Style> </Setter.Value> </Setter> <Setter Property="TextAlignment" Value="Right"/> <Setter Property="DataFormatString" Value="#,#;(#,#);0"/> <Setter Property="FooterTextAlignment" Value="Right"/> </Style> </Window.Resources> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition/> </Grid.RowDefinitions> <telerik:RadToolBar> <telerik:RadButton Click="RadButtonClick" Content="Sum"/> </telerik:RadToolBar> <telerik:RadTreeListView x:Name="grid" Grid.Row="1" AutoGeneratingColumn="RadTreeListViewAutoGeneratingColumn" ItemsSource="{Binding Items, Mode=OneTime}" EnableColumnVirtualization="False" ShowColumnFooters="True"/> </Grid></Window>using System.Windows;using HOME.Samples.TypeDescriber.Objects;using Telerik.Windows.Controls;using Telerik.Windows.Data;namespace HOME.Samples.Client.Wpf.View{ /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow { public MainWindow() { InitializeComponent(); } private void RadTreeListViewAutoGeneratingColumn(object sender, GridViewAutoGeneratingColumnEventArgs e) { if (!(e.ItemPropertyInfo.Descriptor is TestResultPropertyDescriptor)) { return; } e.Column.Style = (Style) FindResource("amountColumnStyle"); e.Column.AggregateFunctions.Add(new SumFunction { ResultFormatString = "{0:#,#;(#,#);0}", }); ((GridViewDataColumn) e.Column).DataFormatString = "#,#;(#,#);0"; } private void RadButtonClick(object sender, RoutedEventArgs e) { grid.CalculateAggregates(); } }}using System.Collections.Generic;using HOME.Samples.TypeDescriber.Objects;namespace HOME.Samples.TypeDescriber.ViewModel{ public class MainWindowViewModel { private readonly IEnumerable<TestResultRowWrapper> _items; public MainWindowViewModel() { _items = new[] { new TestResultRowWrapper {{"00:15", 10}, {"00:16", null}, {"00:17", 0}}, new TestResultRowWrapper {{"00:15", 3}, {"00:16", 9}, {"00:17", null}} }; } public IEnumerable<TestResultRowWrapper> Items { get { return _items; } } }}Hi Telerik Team!
I’m evaluating your WPF control bundle for one of our new applications and have some problems regarding the backstage tab in combination with a WebBrowser control in the content area of my prototype. Although the backstage tab is active, the WebBrowser control is visible and overlaps my backstage-content. Is there a way how I can solve this problem?
Best regards,
Dominik
{
#region Variable Declarations
WpfButton uIBtnButton = this.UINAFTAWindow.UINAFTAExporterGroup.UITxtExporterCustom.UIBtnButton;
#endregion
// Click 'btn' button
Mouse.Click(uIBtnButton, new Point(15, 8));
}
Please let me know what and all references to be added to get RADControlls using coded ui tests
-Sandeep
<telerik:RadGridView AutoExpandGroups="False" AutoGenerateColumns="False" CanUserDeleteRows="False" CanUserFreezeColumns="False" CanUserInsertRows="False" CanUserResizeColumns="True" CanUserSortColumns="True" DataLoadMode="Synchronous" EnableColumnVirtualization="True" EnableRowVirtualization="True" FontSize="16" FontWeight="Bold" Grid.Column="0" Grid.Row="0" IsReadOnly="True" ItemsSource="{Binding Path=HotLists, RelativeSource={RelativeSource AncestorType={x:Type cs:HotListManager}}}" Name="HotListGrid" RowIndicatorVisibility="Collapsed" ScrollViewer.CanContentScroll="True" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" SelectionChanged="HotListGrid_SelectionChanged" SelectionUnit="FullRow" ShowColumnFooters="True" ShowGroupPanel="False" ToolTip="Hot Lists"> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn DataMemberBinding="{Binding Name , Mode=OneWay}" Header="Hot List" Width="*"> <telerik:GridViewDataColumn.AggregateFunctions> <telerik:CountFunction Caption="Count: " ResultFormatString="{}{0:n0}" /> </telerik:GridViewDataColumn.AggregateFunctions> </telerik:GridViewDataColumn> <telerik:GridViewDataColumn DataMemberBinding="{Binding ListType , Mode=OneWay}" Header="List Type" Width="Auto" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding LastUpdate, Mode=OneWay, Converter={StaticResource DateConverter}}" Header="Last Update" MinWidth="160" Width="Auto" /> <telerik:GridViewImageColumn DataMemberBinding="{Binding Status , Mode=OneWay, Converter={StaticResource DeviceStatuses}}" Header="Status" ImageStretch="None" Width="95" /> <telerik:GridViewDataColumn Header="Entries" TextAlignment="Right" MinWidth="125" Width="Auto"> <telerik:GridViewDataColumn.DataMemberBinding> <Binding Path="EntryCount" Mode="OneWay" Converter="{StaticResource LongConverter}" ConverterParameter="#,##0" /> </telerik:GridViewDataColumn.DataMemberBinding> <telerik:GridViewDataColumn.AggregateFunctions> <telerik:SumFunction ResultFormatString="{}{0:n0}" /> </telerik:GridViewDataColumn.AggregateFunctions> </telerik:GridViewDataColumn> </telerik:RadGridView.Columns></telerik:RadGridView>The specified value cannot be assigned to the collection. The following type was expected: "AggregateFunction".using System.Windows;namespace DropDownButtonKeyBehavior{ /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); DataContext = new ViewModel(); } }}<Window x:Class="DropDownButtonKeyBehavior.MainWindow" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" xmlns:commands="clr-namespace:Microsoft.Practices.Prism.Commands;assembly=Microsoft.Practices.Prism" Title="MainWindow" Height="400" Width="200"> <Window.Resources> <DataTemplate x:Key="DropDownContent"> <Grid Background="Orange" Height="300" Width="300"> <Grid Margin="5"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> </Grid.RowDefinitions> <telerik:RadDatePicker /> <Button Name="Save" Grid.Row="1" Content="OK" HorizontalAlignment="Right" Width="105" /> </Grid> </Grid> </DataTemplate> </Window.Resources> <Grid x:Name="LayoutRoot"> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions> <telerik:RadDropDownButton Content="Click Me For Popup" IsOpen="{Binding IsExpanded}" Background="Gray" HorizontalAlignment="Center" VerticalAlignment="Center" Height="90" Width="90" commands:Click.Command="{Binding ExpandCommand}" commands:Click.CommandParameter="{Binding}"> <telerik:RadDropDownButton.DropDownContent> <ContentControl ContentTemplate="{StaticResource DropDownContent}" DataContext="{Binding}" Content="{Binding}" /> </telerik:RadDropDownButton.DropDownContent> </telerik:RadDropDownButton> <TextBox x:Name="FocusHolder" Grid.Row="1"/> </Grid></Window>using System;using System.ComponentModel;using Microsoft.Practices.Prism.Commands;namespace DropDownButtonKeyBehavior{ public class ViewModel : INotifyPropertyChanged { #region ViewModel Members private DelegateCommand<object> mExpandCommand; public DelegateCommand<object> ExpandCommand { get { return mExpandCommand ?? ( mExpandCommand = new DelegateCommand<object>( _OnExpandCommandExecuted ) ); } } private bool mIsExpanded; public bool IsExpanded { get { return mIsExpanded; } set { if( mIsExpanded != value ) { mIsExpanded = value; OnPropertyChanged( "IsExpanded" ); } } } #endregion ViewModel Members #region Ëvents public event PropertyChangedEventHandler PropertyChanged; #endregion Ëvents #region Private Members private void _OnExpandCommandExecuted( object obj ) { IsExpanded = true; } #endregion Private Members #region Protected Members protected virtual void OnPropertyChanged( string propertyName ) { PropertyChangedEventHandler handler = PropertyChanged; if( handler != null ) { handler( this, new PropertyChangedEventArgs( propertyName ) ); } } #endregion Protected Members }}class DataListViewModel : ViewModelBase{ private RadObservableCollection<int> dataList; private Random random = new Random((int) DateTime.Now.Ticks); public DataListViewModel() { this.Data = this.FillRandomlyList(); } public RadObservableCollection<int> Data { get { return dataList; } set { if (value != dataList) { dataList = value; this.OnPropertyChanged("Data"); } } } private RadObservableCollection<int> FillRandomlyList() { var res = new RadObservableCollection<int>(); for (int i = 0; i < 10000; i++) { res.Add(random.Next(500)); } return res; }}<Window x:Class="PerfTest.MainWindow" Title="MainWindow" Height="350" Width="525" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"> <Grid> <telerik:RadCartesianChart Margin="12,12,270,12"> <telerik:RadCartesianChart.Grid> <telerik:CartesianChartGrid MajorLinesVisibility="XY" MajorXLineDashArray="5, 5" MajorYLineDashArray="5, 5"> <telerik:CartesianChartGrid.MajorXLineStyle> <Style TargetType="Line"> <Setter Property="Shape.Stroke" Value="Gray" /> </Style> </telerik:CartesianChartGrid.MajorXLineStyle> <telerik:CartesianChartGrid.MajorYLineStyle> <Style TargetType="Line"> <Setter Property="Shape.Stroke" Value="Gray" /> </Style> </telerik:CartesianChartGrid.MajorYLineStyle> </telerik:CartesianChartGrid> </telerik:RadCartesianChart.Grid> <telerik:RadCartesianChart.HorizontalAxis> <telerik:LinearAxis Visibility="Hidden"/> </telerik:RadCartesianChart.HorizontalAxis> <telerik:RadCartesianChart.VerticalAxis> <telerik:CategoricalAxis Title="Test2" Visibility="Visible" IsInverse="True" /> </telerik:RadCartesianChart.VerticalAxis> <telerik:RadCartesianChart.Behaviors> <telerik:ChartPanAndZoomBehavior /> <telerik:ChartSelectionBehavior /> </telerik:RadCartesianChart.Behaviors> <telerik:RadCartesianChart.Series> <telerik:LineSeries Stroke="IndianRed" CategoryBinding="X" ValueBinding="Y" ItemsSource="{Binding Path=Data}" RenderMode="Light" > <telerik:LineSeries.PointTemplate> <DataTemplate> <Ellipse Fill="DeepPink" Height="5" Width="5" /> </DataTemplate> </telerik:LineSeries.PointTemplate> </telerik:LineSeries> </telerik:RadCartesianChart.Series> </telerik:RadCartesianChart> </Grid></Window>