Telerik Forums
UI for WPF Forum
1 answer
277 views

Hi,

I've an error on a gridview when I try to filter column. This is my code:

        private void SetFilter()
        {
            log.Debug("Start function SetFilter()");
            rgvMain.FilterDescriptors.Clear();

            CompositeFilterDescriptor compositeDescriptor = new CompositeFilterDescriptor();
            compositeDescriptor.LogicalOperator = FilterCompositionLogicalOperator.And;

            if (!string.IsNullOrEmpty(txtfilterCode.Text))
            {
                compositeDescriptor.FilterDescriptors.Add(new Telerik.Windows.Data.FilterDescriptor("LAB_CODE", Telerik.Windows.Data.FilterOperator.Contains, txtfilterCode.Text));
            }
            if (!string.IsNullOrEmpty(txtfilterDescr.Text))
            {
                compositeDescriptor.FilterDescriptors.Add(new Telerik.Windows.Data.FilterDescriptor("LAB_DESCR", Telerik.Windows.Data.FilterOperator.Contains, txtfilterDescr.Text));
            }

            //add all filter to radgrid
            rgvMain.FilterDescriptors.Add(compositeDescriptor);
            log.Debug("End function SetFilter()");
        }

 

This is the StackTrace:

   at Telerik.Windows.Data.Expressions.EnumerableFilterOperatorExpressionBuilder.GenerateContainsMethodCall(Expression source, Expression value, Boolean shouldNegate)
   at Telerik.Windows.Data.Expressions.EnumerableFilterOperatorExpressionBuilder.GenerateContains(Expression left, Expression right)
   at Telerik.Windows.Data.Expressions.FilterOperatorExpressionBuilderBase.CreateExpression(Expression left, Expression right)
   at Telerik.Windows.Data.Expressions.OperatorValueFilterDescriptorExpressionBuilderBase.CreateBodyExpressionThreadSafe()
   at Telerik.Windows.Data.Expressions.OperatorValueFilterDescriptorExpressionBuilderBase.CreateBodyExpression()
   at Telerik.Windows.Data.FilterDescriptor.CreateFilterExpression(ParameterExpression parameterExpression)
   at Telerik.Windows.Data.FilterDescriptorBase.CreateFilterExpression(Expression instance)
   at Telerik.Windows.Data.Expressions.FilterDescriptorCollectionExpressionBuilder.CreateBodyExpressionThreadSafe()
   at Telerik.Windows.Data.Expressions.FilterDescriptorCollectionExpressionBuilder.CreateBodyExpression()
   at Telerik.Windows.Data.CompositeFilterDescriptor.CreateFilterExpression(ParameterExpression parameterExpression)
   at Telerik.Windows.Data.FilterDescriptorBase.CreateFilterExpression(Expression instance)
   at Telerik.Windows.Data.Expressions.FilterDescriptorCollectionExpressionBuilder.CreateBodyExpressionThreadSafe()
   at Telerik.Windows.Data.Expressions.FilterDescriptorCollectionExpressionBuilder.CreateBodyExpression()
   at Telerik.Windows.Data.Expressions.FilterExpressionBuilder.CreateFilterExpression()
   at Telerik.Windows.Data.QueryableExtensions.Where(IQueryable source, CompositeFilterDescriptorCollection filterDescriptors)
   at Telerik.Windows.Data.QueryableCollectionView.CreateView()
   at Telerik.Windows.Data.QueryableCollectionView.CreateInternalList()
   at Telerik.Windows.Data.QueryableCollectionView.get_InternalList()
   at Telerik.Windows.Data.QueryableCollectionView.get_InternalCount()
   at Telerik.Windows.Data.QueryableCollectionView.get_IsEmpty()
   at Telerik.Windows.Data.DataItemCollection.get_IsEmpty()
   at Telerik.Windows.Controls.GridView.BaseItemsControl.OnItemsCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Controls.GridView.GridViewDataControl.OnItemsCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Controls.DataControl.OnItemsCollectionChangedDispatch(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Data.DataItemCollection.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Data.DataItemCollection.OnCollectionViewCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Data.Listener`2.ReceiveWeakEvent(Object sender, TArgs args)
   at Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args)
   at Telerik.Windows.Data.QueryableCollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
   at Telerik.Windows.Data.QueryableCollectionView.RefreshOverride()
   at Telerik.Windows.Data.QueryableCollectionView.RefreshOrDefer()
   at Telerik.Windows.Data.QueryableCollectionView.InvalidatePagingAndRefresh()
   at Telerik.Windows.Data.QueryableCollectionView.OnFilterDescriptorsChanged()
   at Telerik.Windows.Data.QueryableCollectionView.OnFilterDescriptorsCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Data.RadObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Data.ObservableItemCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)
   at Telerik.Windows.Data.RadObservableCollection`1.InsertItem(Int32 index, T item)
   at Telerik.Windows.Data.FilterDescriptorCollection.InsertItem(Int32 index, IFilterDescriptor item)
   at System.Collections.ObjectModel.Collection`1.Insert(Int32 index, T item)
   at System.Collections.ObjectModel.Collection`1.System.Collections.IList.Insert(Int32 index, Object value)
   at Telerik.Windows.Data.CollectionHelper.Insert(IList target, IEnumerable newItems, Int32 startingIndex, IEqualityComparer itemComparer)
   at Telerik.Windows.Data.ObservableCollectionManager.HandleCollectionChanged(IList sender, NotifyCollectionChangedEventArgs args)
   at Telerik.Windows.Data.ObservableCollectionManager.Telerik.Windows.Data.IWeakEventListener<System.Collections.Specialized.NotifyCollectionChangedEventArgs>.ReceiveWeakEvent(Object sender, NotifyCollectionChangedEventArgs args)
   at Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args)
   at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Data.RadObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Data.ObservableItemCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)
   at Telerik.Windows.Data.RadObservableCollection`1.InsertItem(Int32 index, T item)
   at Telerik.Windows.Data.FilterDescriptorCollection.InsertItem(Int32 index, IFilterDescriptor item)
   at System.Collections.ObjectModel.Collection`1.Add(T item)
   at FOX.Module.CommonSearchModules.SupplierPopup.SetFilter() in D:\FOX\Amplifon Fox\New Zealand\Releases\0.16.0\FOX.Module.CommonSearchModules\PopUp\SupplierPopup.xaml.cs:line 274
   at FOX.Module.CommonSearchModules.SupplierPopup.btnSearch_Click(Object sender, RoutedEventArgs e) in D:\FOX\Amplifon Fox\New Zealand\Releases\0.16.0\FOX.Module.CommonSearchModules\PopUp\SupplierPopup.xaml.cs:line 101

Dinko | Tech Support Engineer
Telerik team
 answered on 13 Aug 2018
1 answer
216 views
Is it possible to bind to a collection of providers or something simliar? Binding the Map's Provider property works, but I don't see how to bind other providers.
Dinko | Tech Support Engineer
Telerik team
 answered on 13 Aug 2018
8 answers
411 views
Recently I contacted Telerik regarding the ability of End2End tests over the WPF app which uses Telerik controls.
I used to work with TestStack.White framework previously but encountered some issues while trying to automate
Telerik controls.
After that I asked Telerik about support for TestStack.White and Telerik replied that this framework is not guaranteed to be supported.
And recommended me to use either CodedUI or your own framework claiming that both are supported by your controls.
That’s why I switched to CodedUI.

I've been struggling to automate controls inside the diagrams on canvas (all being Telerik controls)
Our app contains RadDiagram and controls that inherit from RadDiagramShape.

I succeed to get the shapes and test them in the code, but can’t access to the nested items, under the shapes.






Itried to implement control automation both in code using WpfCustom API and via CodedUI Test Builder.
In both case Igot the same error of being unable to find the control by its automation id.
Peshito
Telerik team
 answered on 13 Aug 2018
10 answers
232 views

Hello,

is it possible to set different VerticalAlignment-Properties for RadPanelItems in a RadPanelBar?

I want to vertical align the first item to top (fixed height) and then the second item to stretch with the User Control.

 

I tried this solution, but it won't work:

<telerik:RadPanelBar ExpandMode="Multiple" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
    <telerik:RadPanelBarItem Header="Liveliste" IsExpanded="True" VerticalAlignment="Top">
     <views:StationsLiveView />
           </telerik:RadPanelBarItem>
           <telerik:RadPanelBarItem Header="Teilnehmerliste" IsExpanded="True" VerticalAlignment="Stretch">
               <views:StationsUserView />
           </telerik:RadPanelBarItem>
       </telerik:RadPanelBar>
Dinko | Tech Support Engineer
Telerik team
 answered on 09 Aug 2018
2 answers
112 views

Greetings. 

I have just downloaded and installed the trial for Telerik WPF.  I require a Linear Gauge control.  I have read the documentation and my understanding is that the Linear Gauge control is a container/wrapper of the Linear Scale control.  Should there be a Linear Scale control in the toolbox, because if so, I am not seeing it in the toolbox (VS 2017)??  I was able to manually write some XML code per the example in the documentation for the Scale for my linear gauge, but I'm hoping that is not what is required and that the Linear Scale is a control where I can simply set some properties, etc.  Outside of manually writing code to create the scale, how do I implement a linear scale for a linear gauge control?

Thank you,

Don

 

Dinko | Tech Support Engineer
Telerik team
 answered on 09 Aug 2018
1 answer
212 views

Hi,

I'm following the example provided by telerik in order to develop an application with a radtileview. However, i need to make the items dynamically form the code behind, so my question is how do i define the row and column for each item in the code behind, i.e., similar to what is done in the following example:

     <telerik:RadTileView x:Name="Form" MinimizedItemsPosition="Bottom"
                             MaximizeMode="Zero"
                             DragMode="Swap" PreservePositionWhenMaximized="True" Width="700"
                             RowsCount="{Binding Rows,Mode=TwoWay}"
                             ColumnsCount="{Binding Columns,Mode=TwoWay}">
                <telerik:RadTileView.ItemsPanel>
                    <ItemsPanelTemplate>
                        <local:TemplateForm RowsCount="10" ColumnsCount="4" />
                    </ItemsPanelTemplate>
                </telerik:RadTileView.ItemsPanel>
               <telerik:RadTileViewItem MinWidth="175" MinHeight="45"
                                         local:TileViewProperties.Row="0"
                                         local:TileViewProperties.Column="0"/>

</telerik:RadTileViewItem>

</telerik:RadTileView>

 

Can anyone help me?

 

Thanks

Dinko | Tech Support Engineer
Telerik team
 answered on 09 Aug 2018
1 answer
187 views

hello,

I was recently tasked with adding UI Automation testing to a WPF MVVM application developed by my team.
The application is using RadControls 2018.1 extensively, and I'm struggling to automate actions around RadTreeView.

I've added the steps needed to add Telerik control support to Coded UI, as described this page.
Please note we're using Visual Studio 2017 Enterprise. 

Then, I created a new Coded UI Test Project to my existing solution, and tried to record a simple test using CUIT builder:

  1. Launch the application.
  2. Expand the root of a tree view in the main window.
  3. Expand a RadTreeViewItem (directory).
  4. Double click an item in sub-tree.

When trying to run the recorder test, sometimes it fails to find the RadTreeView, and when it does find it, it fails to navigate the tree correctly (see below).

The main window contains two RadTreeViews, both supplied with a unique AutomationId, both use data-binding, and marked with IsVirtualized. Sometimes the test fails to navigate the first tree (on which we recorded the actions), but succeeds in opening the desired item from the second tree. This is probably due to the both trees being bound to related collections (containing shared items).

Later, I guessed that the issues I'm experiencing might be related to the fact that RadControls doesn't fully implement all levels of CodedUI support. After reading a bit about Progress Test Studio and it's extensive Telerik UI support, I downloaded it's trial version and tried to record the same test.

I used translators and control highlighting context menu, to specifically choose the left-click action on the TreeViewItem's ExpandButton. This way, navigation through the tree actually works, but on the final step, the wrong TreeVIewItem is being double-clicked...

I'm starting to lose fate that our application can actually be automated, and I haven't event started with assertion, or more complex use-cases in our application. Your support will be very welcomed.

Petar Mladenov
Telerik team
 answered on 08 Aug 2018
26 answers
1.5K+ views
Hi

We're evaluating a MultiColumn Treeview.
Is there an easy way to use this RadTreeView with multiple columns?

Thanks for your help!

Thomas
Dilyan Traykov
Telerik team
 answered on 08 Aug 2018
9 answers
174 views

Hi all,

We are currently evaluating different charting libraries for 3D rendering. One of them being Telerik, in trial mode. 

Everything till now looked perfect but we ran into a weird issue while using RadCartesianChart3D. This happens when we are running the application on Machine1 which is Windows 7 and access this machine using remote desktop from Machine 2. When we run the application on Machine 1 we can see all the surface series being rendered correctly. But if I try to access the solution from machine 2(different PC)  using remote desktop session, Visual studio crashes. No Exceptions are caught. 

I have attached the Event Viewer of the machine 1 where the applications is running.
Development environment on machine 1: VS 2017 , .Net framework 4.7.1. 
Telerik Version: See file attached.
We found that,the other parts of the application which renders a RadHeatMap works perfectly fine even in a remote desktop mode. 
Upon further Investigation, it seems that Data Binding could be problematic. I have attached the code below:

The series with no-binding, all data points defined in the Xaml , statically defined, works fine. But the one with the binding to a "test1" object fails during remote desktop session.

<telerik:RadCartesianChart3D x:Name="radView">           
 
           <!--Axis definitions-->
           <telerik:RadCartesianChart3D.XAxis>
               <telerik:LinearAxis3D LabelStyle="{StaticResource LabelStyle}" />
           </telerik:RadCartesianChart3D.XAxis>
           <telerik:RadCartesianChart3D.YAxis>
               <telerik:LinearAxis3D LabelStyle="{StaticResource LabelStyle}"/>
           </telerik:RadCartesianChart3D.YAxis>
           <telerik:RadCartesianChart3D.ZAxis>
               <telerik:LinearAxis3D LabelStyle="{StaticResource LabelStyle}"/>
           </telerik:RadCartesianChart3D.ZAxis>
 
           <telerik:RadCartesianChart3D.Series>
 
               <telerik:SurfaceSeries3D>
                   <telerik:SurfaceSeries3D.DataPoints>
                       <telerik:SurfaceDataPoint3D XValue="10.1" YValue="14.11" ZValue="9.5" />
                       <telerik:SurfaceDataPoint3D XValue="20.2" YValue="21.4" ZValue="7.5" />
                       <telerik:SurfaceDataPoint3D XValue="30.3" YValue="441.4" ZValue="6" />
                       <telerik:SurfaceDataPoint3D XValue="40.4" YValue="22.4" ZValue="6" />
                       <telerik:SurfaceDataPoint3D XValue="50.5" YValue="111.332" ZValue="6.55" />
                       <telerik:SurfaceDataPoint3D XValue="60.6" YValue="221.4" ZValue="6.555" />
                       <telerik:SurfaceDataPoint3D XValue="70.7" YValue="221.2" ZValue="5.55" />
                       <telerik:SurfaceDataPoint3D XValue="80.7" YValue="31.22222" ZValue="5.5" />
                       <telerik:SurfaceDataPoint3D XValue="90.7" YValue="221" ZValue="5" />
                   </telerik:SurfaceSeries3D.DataPoints>
                    
               </telerik:SurfaceSeries3D>
               <telerik:SurfaceSeries3D x:Name="test"
                                    XValueBinding="X"
                                    YValueBinding="Y"                                     
                                    ZValueBinding="Z"
                                    ItemsSource="{Binding test1}">
                   <telerik:SurfaceSeries3D.Colorizer>
                       <telerik:SurfaceSeries3DDataPointColorizer ColorBinding="ColorValue"/>
                   </telerik:SurfaceSeries3D.Colorizer>
 
               </telerik:SurfaceSeries3D>           
           </telerik:RadCartesianChart3D.Series>
       </telerik:RadCartesianChart3D>

Test1 object look like this:

public class test
    {
        public double X { get; set; }
        public double Y { get; set; }
        public double Z { get; set; }
        public Color ColorValue { get; set; }
 
        public PlotInfo(double x, double y, double z)
        {
            X = x;
            Y = y;
            Z = z;
            ColorValue = Color.FromArgb(128, 255, 255, 0);
        }
    }

Further, as soon as I change the types for X, Y and Z to int from doubles, everything is fine and 3D charts are rendered properly.
So In short, the problem is with the RadCartesianChart3D in a remote desktop mode, binding to an object with double values. Any suggestions please?
We are currently in evaluation mode and we would like to wrap it up as soon as possible. If you need more details please let me know.

Vladimir Stoyanov
Telerik team
 answered on 08 Aug 2018
3 answers
649 views

I am using a Telerik theme (VisualStudio2013) and want to change the color of certain controls within my ListBox depending on the selection state.  So in my contrived example below I want the BorderBrush and Separator Background to become blue (the VisualStudio2013 color) when the associated ListBoxItem is selected. 

My attempt shown below with a RelativeSource binding does not work.

<Window x:Class="TelerikWpfApp2.MainWindow"
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                DataContext='{Binding RelativeSource={RelativeSource Self}}'
                Title="MainWindow" Height="350" Width="525">
    <Window.Resources>
        <DataTemplate x:Key="MyItemTemplate">
            <StackPanel>
                <Label Content="{Binding}"/>
                <Border Height="30" Background="White" BorderBrush="{Binding Background, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadListBoxItem}}}" Padding="2" BorderThickness="5">
                    <Separator Background="{Binding Background, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadListBoxItem}}}" Height="4" Margin="6"></Separator>
                </Border>
            </StackPanel>
        </DataTemplate>
    </Window.Resources>
        <Grid>
        <telerik:RadListBox ItemTemplate="{StaticResource MyItemTemplate}" ItemsSource="{Binding TheList}">
        </telerik:RadListBox>
    </Grid>
</Window>
public partial class MainWindow : Window
{
    public ObservableCollection<string> TheList { get; set; } = new ObservableCollection<string> () {"A","B","C"};
    public MainWindow ()
    {
        InitializeComponent();
     }
}

 

Dinko | Tech Support Engineer
Telerik team
 answered on 08 Aug 2018
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
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?