Telerik Forums
UI for WPF Forum
1 answer
392 views

Hello,

I have a RadcomboBox with Multiple Selection allowed. The ItemSource of this combo is a enum.

 public enum WorkStatus   {

        [Description("WORKING")]
        Working,
        [Description("NOT WORKING")]
        Not_Working,
        [Description("WORKING WITH ERRORS")]
        Working_with_errors,
        [Description("STOPPED")]
        Stopped
    }

And this is my code:

<Window x:Class="MultiSelectComboboxEnums.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"
        xmlns:local="clr-namespace:MultiSelectComboboxEnums"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        Title="MainWindow"
        Height="350"
        Width="525">

    <Window.Resources>
        <ObjectDataProvider x:Key="statesWork"
                            MethodName="GetValues"
                            ObjectType="{x:Type sys:Enum}">
            <ObjectDataProvider.MethodParameters>
                <x:Type TypeName="local:WorkStatus" />
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>

        <local:EnumToFriendlyNameConverter x:Key="enumToFriendlyNameConverter" />
    </Window.Resources>

    <Grid>
        <telerik:RadComboBox Width="350"
                             Height="26"
                             Margin="20"
                             HorizontalAlignment="Center"
                             VerticalAlignment="Center"
                             telerik:StyleManager.Theme="Windows8"
                             ItemsSource="{Binding Source={StaticResource statesWork}}"
                             ClearSelectionButtonVisibility="Visible"
                             IsSynchronizedWithCurrentItem="False"
                             AllowMultipleSelection="True"
                             MultipleSelectionSeparator="|"
                             MultipleSelectionSeparatorStringFormat="{} {0} ">
            <telerik:RadComboBox.ItemTemplate>
                <DataTemplate>
                    <Label Height="Auto"
                           Margin="0"
                           VerticalAlignment="Center"
                           Content="{Binding Path=., Mode=OneWay, Converter={StaticResource enumToFriendlyNameConverter}}" />
                </DataTemplate>
            </telerik:RadComboBox.ItemTemplate>
        </telerik:RadComboBox>
    </Grid>
</Window>

 

In dropdown item I can see the correct name using a converter but how can I do to see the same in the selected items box?

I attached two images showing this error.

Thanks in advance.

Kalin
Telerik team
 answered on 11 Aug 2017
5 answers
469 views

Hi.

I'm considering the purchase of UI for WPF, so I downloaded to test the trial version.

I'm working through this example (http://docs.telerik.com/devtools/wpf/controls/raddataservicedatasource/getting-started/creating-the-data-bound-controls), but instead of WCF services, I'm using OData version 7.

Everything works fine, except when I'm trying to apply even a single filter on columns containing enum elements, I'm getting this exception :

Babken Gevorgyan, [01.08.17 13:36]
System.Windows.Data Error: 8 : Cannot save value from target back to source. BindingExpression:Path=IsActive; DataItem='DistinctValueViewModel' (HashCode=2921675); target element is 'CheckBox' (Name=''); target property is 'IsChecked' (type 'Nullable`1') NotSupportedException:'System.NotSupportedException: Could not convert constant Credit expression to string.
   at Microsoft.OData.Client.ExpressionWriter.VisitConstant(ConstantExpression c)
   at Microsoft.OData.Client.ALinqExpressionVisitor.Visit(Expression exp)
   at Microsoft.OData.Client.DataServiceALinqExpressionVisitor.Visit(Expression exp)
   at Microsoft.OData.Client.ExpressionWriter.Visit(Expression exp)
   at Microsoft.OData.Client.ExpressionWriter.VisitOperand(Expression e, Nullable`1 parentType, Nullable`1 childDirection)
   at Microsoft.OData.Client.ExpressionWriter.VisitBinary(BinaryExpression b)
   at Microsoft.OData.Client.ALinqExpressionVisitor.Visit(Expression exp)
   at Microsoft.OData.Client.DataServiceALinqExpressionVisitor.Visit(Expression exp)
   at Microsoft.OData.Client.ExpressionWriter.Visit(Expression exp)
   at Microsoft.OData.Client.ExpressionWriter.ExpressionToString(DataServiceContext context, Expression e, Boolean inPath, Version& uriVersion)
   at Microsoft.OData.Client.UriWriter.VisitQueryOptionExpression(FilterQueryOptionExpression fqoe)
   at Microsoft.OData.Client.UriWriter.VisitQueryOptions(ResourceExpression re)
   at Microsoft.OData.Client.UriWriter.VisitQueryableResourceExpression(QueryableResourceExpression rse)
   at Microsoft.OData.Client.DataServiceALinqExpressionVisitor.Visit(Expression exp)
   at Microsoft.OData.Client.UriWriter.Translate(DataServiceContext context, Boolean addTrailingParens, Expression e, Uri& uri, Version& version)
   at Microsoft.OData.Client.DataServiceQueryProvider.Translate(Expression e)
   at Microsoft.OData.Client.DataServiceQuery`1.get_RequestUri()
   at Telerik.Windows.Data.QueryableDataServiceCollectionView`1.ReturnsSingleEntity(DataServiceQuery`1 query)
   at Telerik.Windows.Data.QueryableDataServiceCollectionView`1.BuildDataServiceQuery(Int32 pageIndex)
   at Telerik.Windows.Controls.DataServices.QueryableDataServiceCollectionViewBase.CompletePageMove(Int32 newPageIndex)
   at Telerik.Windows.Data.QueryableCollectionView.MoveToPageCore(Int32 index)
   at Telerik.Windows.Controls.DataServices.QueryableDataServiceCollectionViewBase.MoveToPageCore(Int32 index)
   at Telerik.Windows.Data.QueryableCollectionView.InvalidatePaging()
   at Telerik.Windows.Data.QueryableCollectionView.InvalidatePagingAndRefresh()
   at Telerik.Windows.Data.QueryableCollectionView.OnFilterDescriptorsChanged()
   at Telerik.Windows.Data.QueryableDataServiceCollectionView`1.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)

Babken Gevorgyan, [01.08.17 13:36]
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 Telerik.Windows.Controls.GridViewColumn.OnColumnFilterDescriptorPropertyChanged(Object sender, PropertyChangedEventArgs e)
   at Telerik.Windows.Data.DescriptorBase.OnPropertyChanged(PropertyChangedEventArgs args)
   at Telerik.Windows.Data.DescriptorBase.OnPropertyChanged(String propertyName)
   at Telerik.Windows.Data.DescriptorBase.ResumeNotifications()
   at Telerik.Windows.Controls.GridView.FilteringViewModel.ApplyFilters()
   at Telerik.Windows.Controls.GridView.FilteringViewModel.OnDistinctValuesChanged()
   at Telerik.Windows.Controls.GridView.FilteringViewModel.OnDistinctValuesItemChanged(Object sender, ItemChangedEventArgs`1 e)
   at Telerik.Windows.Data.ObservableItemCollection`1.RaiseGenericItemChanged(ItemChangedEventArgs`1 e)
   at Telerik.Windows.Data.ObservableItemCollection`1.OnItemChanged(ItemChangedEventArgs`1 e)
   at Telerik.Windows.Data.ObservableItemCollection`1.Telerik.Windows.Data.IWeakEventListener<System.ComponentModel.PropertyChangedEventArgs>.ReceiveWeakEvent(Object sender, PropertyChangedEventArgs args)
   at Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args)
   at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
   at Telerik.Windows.Controls.ViewModelBase.OnPropertyChanged(String propertyName)
   at Telerik.Windows.Controls.GridView.DistinctValueViewModel.set_IsActive(Boolean value)'

 

Thanks.

Yoan
Telerik team
 answered on 10 Aug 2017
1 answer
112 views

Hi,

I need to attach my project how should i attach it was a .Zip file.

I am having an issue in RadTabItem with ContentControl which hides the DockPanel.

If you run the attached project you may see the PresetTitle Dockpanel in the right hand side of the window and mouse over to the PresetTitle Content(Don't pin the dock panel)you may see 3 Tab's underneath(Preset,group,SiteSee) that and select all the 3 Tab's one by one continuously for 3 or more times and it automatically hide the PresetTitle dockpanel that should not happen.

If i have not use the ContentControl it works fine.

Please check in the project that Goto TestUserControl.xaml uncomment the line from 32 to 37 and comment the line 38 and run the application  it is working as expected.

My scenario is i need to use the contentControl inside the Tab Control.

Please check and let me know what i am doing wrong.

Thanks In Advance :)

Regards,
P.Sathish Kumar

Dilyan Traykov
Telerik team
 answered on 10 Aug 2017
4 answers
264 views

I have a Telerik Treeview on a Telerik Docking RadPane. If the pane is unpinned, so the user no longer can see the tree, a call to GetItemByPath returns null.

I give the user an option to pin the pane, and navigate the tree, or unpin the pane, and click "Next" and "Previous" buttons to navigate the tree. If the pane is pinned and the tree is visible, GetItemByPath returns the RadTreeViewItem. If the tree is hidden, GetItemByPath returns null.

If I expand all nodes on the tree first, GetItemByPath returns the RadTreeViewItem even when the tree is hidden. I have IsVirtualizing set to false.

Is there a way to set the SelectedItem using GetItemByPath when the tree is not visible? Or is there another call I can make?

Thanks,

Scott

Scott Michetti
Top achievements
Rank 1
Iron
 answered on 10 Aug 2017
1 answer
64 views

I'm using a CellStyleSelector to switch the style based on some properties of the model bound to the row

When I'm persisting the layout i need to save those style (Background and Foreground color) on two properties of my Columnproxy.

Before using the CellStyleSelector I was getting the column.CellStyle but now I got a null on that property and I'm unable to retrieve the current cell style.

Is it possible or since it's done on the fly I cannot have it?

Thanks

Dinko | Tech Support Engineer
Telerik team
 answered on 10 Aug 2017
1 answer
139 views

Hi,

i creat a diagram with the radDiagram Control, saving it as xml-file, workin fine! It is possible to find all
Elements in the Diagram with c#, so i can wirte my own xml-file?

 

Thanks
Best Regards
RENE

Dinko | Tech Support Engineer
Telerik team
 answered on 10 Aug 2017
5 answers
231 views

Hello,

Our company developer team is trying your product and we are wondering if its possible to set the Width and Height of the Diagram, we tried all the examples in the documentation from viewport to set a container in the center of the diagram and use it as a diagram, we used services, dragging area restrictions but non of then are working as expected.

Our main goal is the following:

We have a grid with 2 Rows (1 for buttons/ the other one for the diagram), out clients need to be able to set the area of the diagram that in the future will export the elements that are inside it. 

We tried to set the height and witdth of the diagram and also the size of the viewport,however, the result is just a smaller view of the diagram but not a real smaller page.

Would you be able to help us?

As commented before we tried to implement the examples from Github, forum and documentation without success.

We will wait for your answer, thanks.

Petar Mladenov
Telerik team
 answered on 10 Aug 2017
4 answers
252 views
I am hooking up "Opening" event of RadContextMenu to load the menuItems dynamically on tree nodes based on the type of node. But it doesn't work for the first right click, rather it loads the menuItems correctly afterwards based on the type of tree node on which this menu is being loaded.
Tayyaba
Top achievements
Rank 1
 answered on 10 Aug 2017
1 answer
120 views

Hi,

I want to customize the BoxItem in single selection mode. As per documentation, there is no other way to customize the boxItem in Single selection mode. Because of this constraint, It is blocking our development. Any one can help me in this situation.

Regards,

Viswa Teja.

Dilyan Traykov
Telerik team
 answered on 09 Aug 2017
11 answers
2.5K+ views
Greetings,

I am hopping someone in the community knows what may cause the following exception:

System.ArgumentException: Invalid property or field - '[name]' for type: Object

Currently we are experiancing this exception any time we click on the filter icon on a column and before the filter dialog is displayed or any time we attempt to group by a column.  Filtering and grouping thru API calls works fine.

Version: WPF_2009_Q2_SP1

Target Site:
{Telerik.Windows.Data, Version=2009.2.813.35, Culture=neutral, PublicKeyToken=5803cfa389c90ce7}
{System.Linq.Expressions.Expression CreateMemberAccessExpression(Telerik.Windows.Data.Expressions.IMemberAccessToken, System.Linq.Expressions.Expression)}
Stefan
Telerik team
 answered on 09 Aug 2017
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
Slider
Expander
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
WebCam
CardView
DataBar
Licensing
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
HighlightTextBlock
Security
TouchManager
StepProgressBar
VirtualKeyboard
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?