Telerik Forums
UI for WPF Forum
0 answers
109 views

We are unable to automate testing for our WPF application using MS Coded UI test. The sample application contains a RadGridView with just two columns. In one column, we have added a button which displays a Message Box on click. We are trying to automate this button click.

The grid is defined like this:

<telerik:RadGridView x:Name="MyLinkGrid" Height="135" AutoGenerateColumns="False" Margin="10" Width="300">

    <telerik:RadGridView.Columns>

        <telerik:GridViewDataColumn x:Name="GridViewDataColumnID" Header="ID" DataMemberBinding="{Binding Name}" />

        <telerik:GridViewColumn x:Name="GridViewDataColumnName" Header="Name" IsReadOnly="True">

            <telerik:GridViewColumn.CellStyle>

                <Style TargetType="telerik:GridViewCell">

                    <Setter Property="Template">

                        <Setter.Value>

                            <ControlTemplate>

<Button x:Name="colID" Content="{Binding ID}" VerticalContentAlignment="Center" Foreground="Blue" Click="Button_Click" Width="Auto" AutomationProperties.AutomationId="{Binding ID}" />

                            </ControlTemplate>

                        </Setter.Value>

                    </Setter>

                </Style>

            </telerik:GridViewColumn.CellStyle>

        </telerik:GridViewColumn>

    </telerik:RadGridView.Columns>

</telerik:RadGridView>

private void Button_Click(object sender, RoutedEventArgs e)

{

    MessageBox.Show("Button_Click");

}

During playback the button click event is not automated.

However if we move the ID column after the Name column, the button click event is played back and message box is displayed.

Attached is the sample WPF app along with the Coded UI test project.

Also if we add DataTemplate to our column definition, the button click event doesn’t occur during playback. 

Tim
Top achievements
Rank 1
 asked on 04 Sep 2013
1 answer
312 views
The default implementation of the UndoRedoService is way too picky. Every possible UI transition adds an entry to the undo buffer. We don't want the user to be able to undo certain operations. E.g. when you click on a node, its ZIndex changes - implying a "Undo Set ZIndex" in the undo buffer. There are certainly more of these unnecessary undoables.

How can we customize this undo/redo behavior?
Pavel R. Pavlov
Telerik team
 answered on 04 Sep 2013
3 answers
149 views
Hi,

as you can see on the attached file, i have a category "Aufgabe" and a Resource called "Art" which contains the same items
like "Urlaub". Now i want to Change the Category and i want to Change the Resource item too. Same way if i Change the Resource Item
the category item should change too.

Thanks
Best Regards
Rene
Yana
Telerik team
 answered on 04 Sep 2013
2 answers
174 views
I am curious if it is possible to add a lineseries (or other series) to a CartesianChartGrid with the characteristics of the "desired line" within the attached file.

This line will track a digital state, so the only values will be 0 and 1.  When changing value, we wish to produce the effect of a vertical line such as a block, rather than a gradual climb or descent as such in the "current line".

Below is the code which creates the "current line" series:

 

var outputsuperImposedLineSeries = new LineSeries();
outputsuperImposedLineSeries.ValueBinding = new PropertyNameDataPointBinding("Value");
outputsuperImposedLineSeries.CategoryBinding = new PropertyNameDataPointBinding("Timestamp");
outputsuperImposedLineSeries.ItemsSource = superImposedMappings.Groups.First() as IEnumerable;
outputsuperImposedLineSeries.Stroke = Brushes.Purple;
outputsuperImposedLineSeries.TrackBallInfoTemplate = BuildTrackBallInfoTemplate(Brushes.Purple.ToString(), name, 4);
outputsuperImposedLineSeries.VerticalAxis = new LinearAxis { Minimum = 0, ElementBrush = Brushes.Purple, Title = name, HorizontalLocation = Telerik.Charting.AxisHorizontalLocation.Right };
superImposedSeries.Add(outputsuperImposedLineSeries);

Is this desired effect possible?

Thank you for your time,
-Brett

Edit:
The title should read "Help for creating a series to track digital values similar to a step".  My apologies for the incorrect title.
Brett
Top achievements
Rank 1
 answered on 03 Sep 2013
2 answers
117 views
Hi there, everytime I run my app appears this message in every RadGridView.
is there any possibility to delete them?

By the way, I'm using the under trial license

"Arrastre el encabezado del grupo....."
Enric
Top achievements
Rank 1
 answered on 03 Sep 2013
16 answers
3.3K+ views
Hi guys,

   I'm a WPF developer, and I'm looking for some sample code that will show me how to set the radGridView row background color based on the value of a column in the row. Do you have an example that will do so?
   Specifically, I want to set a row's background color to Red if the value of Due_Date is within 1 day of today, and to Yellow if it's between 2 and 3 days from today.

Thanks,

Les
Claudio
Top achievements
Rank 1
 answered on 03 Sep 2013
3 answers
547 views
How do I create summary rows in wpf . We are switching our windows form project to wpf and we are doing this in winforms:

var actualInItem = new GridViewSummaryItem("ActualIn", "{0:C}", GridAggregateFunction.Sum);<br>                var actualOutItem = new GridViewSummaryItem("ActualOut", "{0:C}", GridAggregateFunction.Sum);<br>                var grossItem = new GridViewSummaryItem("Gross", "{0:C}", GridAggregateFunction.Sum);<br>                var operatorShareItem = new GridViewSummaryItem("OperatorShare", "{0:C}", GridAggregateFunction.Sum);<br>                var CmsnLocationItem = new GridViewSummaryItem("CmsnLocation", "{0:C}", GridAggregateFunction.Sum);<br>                var overShortItem = new GridViewSummaryItem("OverShort", "{0:C}", GridAggregateFunction.Sum);<br>                var PayoutPercentage = new GridViewSummaryItem("PayoutPercentage", "Avg: {0:P1}", GridAggregateFunction.Avg);<br><br>                var summaryRowItem = new GridViewSummaryRowItem(<br>                    new[] { actualInItem, actualOutItem, grossItem, overShortItem, operatorShareItem, CmsnLocationItem, PayoutPercentage });<br><br><br>                template.SummaryRowsBottom.Add(summaryRowItem);

I can understand the aggregate functions can be done in my viewmodel but how do I add the summary row. Also, I have already used the row detail to display a child grid if that matters.
Dimitrina
Telerik team
 answered on 03 Sep 2013
3 answers
197 views
Hi!

Is is possible to get GridViewGroupPanelText to refresh when application culture changes? I have created custom resx (GridViewResources.en.resx and GridViewResources.resx) and it's working on initialization but does not change when the culture is changed during application execution.
 
I have added ResourceManager to .xaml.cs like this:

public BillingView()
{
     
    LocalizationManager.Manager = new LocalizationManager()
    {
        ResourceManager = GridViewResources.ResourceManager
    };
 
    InitializeComponent();
}

Br,

Kalle
Dimitrina
Telerik team
 answered on 03 Sep 2013
1 answer
121 views
Greetings.

The code below (see partial XAML and C#) display the grid of "Prospects".
Prospect's First, Last, and Middle name are GridViewDynamicHyperlinkColumn. User can click on one of those three columns and be redirected to the Prospect's edit form.
All this works perfectly until user decides to sort the grid (no matter which column).
After the grid has been sorted, clicking on First, Last, or Middle name has NO EFFECT.

Am I missing something?
If there is anything wrong, I certainly can't see it anymore.
Please help.

Thank you,

Frank M.

 

private void OnProspectGridUnLoaded(object sender, Telerik.Windows.Controls.GridView.RowUnloadedEventArgs e) {
    var row = e.Row as GridViewRow;
    if (row != null) {
        ((HyperlinkButton)row.Cells[0].Content).RemoveHandler(FrameworkElement.MouseLeftButtonDownEvent, new MouseButtonEventHandler(OnProspectLinkClicked));
        ((HyperlinkButton)row.Cells[1].Content).RemoveHandler(FrameworkElement.MouseLeftButtonDownEvent, new MouseButtonEventHandler(OnProspectLinkClicked));
        ((HyperlinkButton)row.Cells[2].Content).RemoveHandler(FrameworkElement.MouseLeftButtonDownEvent, new MouseButtonEventHandler(OnProspectLinkClicked));
    }
}
 
private void OnProspectGridLoaded(object sender, Telerik.Windows.Controls.GridView.RowLoadedEventArgs e) {
    var row = e.Row as GridViewRow;
    if (row != null) {
        ((HyperlinkButton)row.Cells[0].Content).AddHandler(FrameworkElement.MouseLeftButtonDownEvent, new MouseButtonEventHandler(OnProspectLinkClicked), true);
        ((HyperlinkButton)row.Cells[1].Content).AddHandler(FrameworkElement.MouseLeftButtonDownEvent, new MouseButtonEventHandler(OnProspectLinkClicked), true);
        ((HyperlinkButton)row.Cells[2].Content).AddHandler(FrameworkElement.MouseLeftButtonDownEvent, new MouseButtonEventHandler(OnProspectLinkClicked), true);
    }
}
 
 
private void OnProspectLinkClicked(object sender, MouseButtonEventArgs e) {
    try {
        Type type = e.Source.GetType();
        if (type == typeof(System.Windows.Controls.ContentPresenter)) {
            DataRowView rowView = (DataRowView)((Telerik.Windows.Controls.GridView.GridViewCell)((((Telerik.Windows.Controls.GridView.HyperlinkButton)(sender)).Parent))).ParentRow.Item;
            DataRow selectedRow = (DataRow)rowView.Row;
            if (selectedRow != null && selectedRow[0] != DBNull.Value) {
                ProspectInformation.ProspectId = Convert.ToString(selectedRow["ProspectGuid"]);
                if (ProspectInformation.ProspectId != null && ProspectInformation.ProspectId != string.Empty) {
                    ((POWERPitch.Base.TabPanel)(((TabControl)parent).Parent)).IsFromHomePage = true;
                    ((POWERPitch.Base.TabPanel)(((TabControl)parent).Parent)).LinkName = Contexts.QuickLinkNames.OPEN_PROSPECT;
                    ((TabControl)parent).SelectedIndex = 2;
                }
            }
        }
    } catch (Exception ex) {
        IPMessageBox.ShowExceptionMessage("Exception in HomeForAgents.OnProspectLinkClicked " + ex.Message);
    }
}

 

<telerik:RadBusyIndicator DisplayAfter="0" x:Name="radBusyIndicator" Background="Transparent"
    HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" >
 
 <telerik:RadGridView Name="searchResultsGridView" EnableRowVirtualization="True" CanUserSortColumns="True"
    ColumnWidth="*" CanUserDeleteRows="False" IsReadOnly="True" IsFilteringAllowed="False" CanUserInsertRows="False"
    VerticalAlignment="Top" RowLoaded="OnSearchResultsGridLoaded" SelectionChanged="OnSearchResultsSelectionChanged"
    RowUnloaded="OnSearchResultsGridUnLoaded" Height="Auto" Width="Auto" Margin="5,3,5,0" Style="{StaticResource
    GridViewStyle}" HeaderRowStyle="{StaticResource HeaderStyle}" >
 
 <telerik:RadGridView.Columns>
 
     <telerik:GridViewDataColumn Name="createDateCol" Header="Last Updated" Width="Auto" DataMemberBinding="{Binding
        CreatedDate}" HeaderCellStyle="{StaticResource ColumnHeaderStyle}" CellStyle="{StaticResource
        gridcellStyle}"/>
 
     <telerik:GridViewDynamicHyperlinkColumn Name="lastNameCol" Header="Last Name" Width="Auto"
         DataMemberBinding="{Binding LastName}" HeaderCellStyle="{StaticResource ColumnHeaderStyle}"
        CellStyle="{StaticResource gridcellStyle}"/>
 
     <telerik:GridViewDynamicHyperlinkColumn Name="firstNameCol" Header="First Name" Width="Auto"
        DataMemberBinding="{Binding FirstName}" HeaderCellStyle="{StaticResource ColumnHeaderStyle}"
        CellStyle="{StaticResource gridcellStyle}"/>
 
     <telerik:GridViewDataColumn Name="dateOfBrthCol" Header="Age" Width="Auto" DataMemberBinding="{Binding DOB}"
        HeaderTextAlignment="Center" TextAlignment="Center" HeaderCellStyle="{StaticResource ColumnHeaderStyle}"
        CellStyle="{StaticResource gridcellStyle}"/>
 
     <telerik:GridViewDataColumn Name="genderCol" Header="G" Width="Auto" DataMemberBinding="{Binding Gender}"
        HeaderCellStyle="{StaticResource ColumnHeaderStyle}" CellStyle="{StaticResource gridcellStyle}"/>
 
     <telerik:GridViewDataColumn Name="stateCol" Header="ST" Width="Auto" DataMemberBinding="{Binding StateCode}"
        HeaderCellStyle="{StaticResource ColumnHeaderStyle}" CellStyle="{StaticResource gridcellStyle}"/>
 
     <telerik:GridViewDataColumn Name="quoteIdCol" Header="Quote/Illustration" Width="Auto"
        HeaderTextAlignment="Left"     TextAlignment="Left" DataMemberBinding="{Binding QuoteId}"
         HeaderCellStyle="{StaticResource ColumnHeaderStyle}" CellStyle="{StaticResource gridcellStyle}"/>
 
     <telerik:GridViewDynamicHyperlinkColumn Name="prodDescCol" Header="Product Summary" UniqueName="prodDescCol"
         DataMemberBinding="{Binding ProductDesc}" HeaderCellStyle="{StaticResource ColumnHeaderStyle}"
        CellStyle="{StaticResource gridcellStyle}"/>
 
     <telerik:GridViewDataColumn Name="annPremCol" Header="Annual Premium" Width="Auto" DataMemberBinding="{Binding
        AnnualPremium}" HeaderTextAlignment="Right" TextAlignment="Right" HeaderCellStyle="{StaticResource
        ColumnHeaderStyle}" CellStyle="{StaticResource gridcellStyle}"/>
 
     <telerik:GridViewDataColumn Name="agntCdCol" Header="Agent Code" Width="Auto" DataMemberBinding="{Binding
        AgentCode}" HeaderTextAlignment="Right" TextAlignment="Right" HeaderCellStyle="{StaticResource
        ColumnHeaderStyle}" CellStyle="{StaticResource gridcellStyle}"/>
 
     <telerik:GridViewDataColumn Name="agntNameCol" Header="Agent Name" Width="Auto" DataMemberBinding="{Binding
        AgentName}" HeaderCellStyle="{StaticResource ColumnHeaderStyle}" CellStyle="{StaticResource gridcellStyle}"/>
 
     <telerik:GridViewDataColumn Name="gaCodeCol" Header="GA Code" Width="Auto" DataMemberBinding="{Binding GACode}"
         HeaderTextAlignment="Right" TextAlignment="Right" HeaderCellStyle="{StaticResource ColumnHeaderStyle}"
        CellStyle="{StaticResource gridcellStyle}"/>
 
     </telerik:RadGridView.Columns>
 
   </telerik:RadGridView>
 
 </telerik:RadBusyIndicator>
Dimitrina
Telerik team
 answered on 03 Sep 2013
1 answer
151 views
Dear Telerik Support Team!

I am so beginner with C# and WPF technologic. My managers liked the telerik's options what they could saw with your demos.
I have to use Oracle 11g database server, therefore I maked a sample OLAP database and sample cubes.
I have a hostname(192.168.81.112), a port(1521), and a SID(orcl), and a username, and password to identify that oracle database connection. I found some sample what you have done (RadPivotGrid-XmlaDataProvider-SimpleApp-SL) it looks like those maked to microsoft databases.
The cube name is SALES_CUBE and the used dimensions are: CHANNEL, TIME, GEOGRAPHY, PRODUCT.
Do you have any sample code how could i use any provider to oracle olap cube?

Thank you in anticipation,
Best regards,

Ed
Rosen Vladimirov
Telerik team
 answered on 03 Sep 2013
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
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
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
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?