Telerik Forums
UI for WPF Forum
1 answer
185 views
At the moment in my resource dictionary I have a telerik Tile control. When it's instantiated a second time I receive the follow error `Specified Visual is already a child of another Visual or the root of a CompositionTarget`

public void ListIcon()
{
    var tile = Application.Current.Resources["ListTile"] as Tile;       
    Tiles.Add(tile);
}


app.xaml

<telerik:Tile x:Key="Calendar" TileType="Double" Background="#FF79256B" Group="Other">
    <telerik:RadCalendar x:Name="calendar"
                  FontFamily="Segoe UI"
                  FontSize="10"
                  controls:StyleManager.Theme="Windows8"
                  VerticalAlignment="Top" HorizontalAlignment="Center"
                  SelectionMode="Extended"
                  IsTodayHighlighted="True" ViewsHeaderVisibility="Collapsed"                                    
                  SelectedDate="{Binding SelectedDate, Mode=TwoWay}"
                  Culture="en-US"
                  DayTemplateSelector="{StaticResource EventDayTemplateSelector}"/>
</controls:Tile>

 

Everytime a new user is logged in, ListIcon() is called. If I log out and log into a second user the error occurs. May I ask how do I resolve this.

Martin
Telerik team
 answered on 12 Aug 2016
6 answers
1.8K+ views
Hello,

Is it possible to change default behavior of RadGridView so when user press Ctrl+C it is copy current cell value into clipboard not the entire row?

Thanks
Gavin
Top achievements
Rank 1
 answered on 12 Aug 2016
18 answers
1.0K+ views
Hi,

I have a Listbox with a datatemplate:
<DataTemplate x:Key="ListBoxDataTemplate">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding FieldName, Mode=TwoWay}" Width="120" />
                <telerik:RadAutoCompleteBox Width="197" Name="autoCompBox"
                        Background="Beige" SelectionMode="Multiple" TextSearchMode="StartsWith"
                        TextSearchPath="Code" AutoCompleteMode="Suggest"
                        DropDownItemTemplate="{StaticResource ContactSearchTemplate}" DataContext="{Binding}"
                        ItemsSource="{Binding DataContext.Codes, Mode=TwoWay, RelativeSource={RelativeSource AncestorType=telerik:RadListBox}}"
                        SelectedItems="{Binding Path=AssociatedCodes, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
                </telerik:RadAutoCompleteBox>
            </StackPanel>
        </DataTemplate>
My ListBox ItemsSource property is binded to a property in ViewModel named:
public List<ReportDataAssociation> ReportDataAssociation
        {
            get { return m_reportDataAssociation; }
            set { m_reportDataAssociation = value; OnPropertyChanged("ReportDataAssociation"); }
        }

This property is an object with the following properties:
string FieldName;
ObservableCollection<ReportCodes> AssociatedCodes;
The FieldName is binded to the TextBlock
The AssociatedCodes is binded to the SelectedItemsProperty of each AutoCompleteBox.

I load an ObservableCollection<ReportCodes> named Codes which is binded to all AutoCompleteBoxes.
The AssociatedCodes is a property of ReportDataAssociation which is binded to SelectedItems.
Any ReportCode I add to the AssociatedCodes' List is from the ObservableCollection<ReportCodes> named Codes
so the referece to the object is the same.

The problem is:
When I select or delete some items from some autocompletebox,
the property AssociatedCodes does not change.
When I change the property AssociatedCodes at runtime, the selectedItems in autocompletebox
don't change.
I think it's a binding problem but i can't figure out what it is.
Maybe because the AutoCompleteBoxes are in a template.

I tried to bind the selectedItems in many ways, the binding shown above is one of my many tries..
Please help
Thanx in advance

Yana
Telerik team
 answered on 12 Aug 2016
3 answers
288 views

Hi telerik support

I have a telerik license for the wpf controls and we are using 2012 version (2012.2.725.40).

Now, i want to try the telerik reports. 

For this i'd created a separate solution (Visual studio solution) which contains 2 projects (one for reporting lib and another one for wpf) which is working fine with no issues.

Now the problem is when i try to integrate with my existing wpf application, what i did as follows

1. Added the ReportLib project to the existing solution

2. Added new window for the report in which added a reportViewer control ( as given by the telerik samples, which is also working fine as i said above)

Now the issue is, Since i'm already using telerik controls inside my application, the report viewer is not showing in the window

Can you please help me, how to resolve this?

NOTE: I'd also tried adding the latest dlls(  Telerik.Windows.Data.dll, Telerik.Windows.Controls.Input,Telerik.Windows.Controls.Navigation, Telerik.Windows.Controls). by doing so, my existing controls are not working (build error)

Katia
Telerik team
 answered on 12 Aug 2016
3 answers
179 views

I know there's probably a simple solution to this problem but I cant find it for the life of me. Im trying to use RadMap in order to display a floor plan that I can later add points to similar to the demo shown here. The issue that im facing is that I cant get the Floor plan to appear. Ive tried using different images with different sizes and that has yet to yield any results when I run it I simply see a blank canvass with the coordinates. The floor plan is saved as a FloorMap.png and for now I have placed it in my desktop. I was not sure how to set the GeoBounds so I have left them as they appear in the sample used here

<UserControl x:Class="testingxaml.MainPage"
            HorizontalAlignment="Center" VerticalAlignment="Center"
             mc:Ignorable="d" d:DesignWidth="625" d:DesignHeight="629">
    <Grid x:Name="LayoutRoot">
 
        <telerik:RadMap x:Name="xRadMap"
                        NavigationVisibility="Collapsed"
                        ZoomBarVisibility="Collapsed"
                        CommandBarVisibility="Collapsed"
                        Center="42.72481708629, 23.3176519378416">
             
                         
            <telerik:RadMap.Provider>
                <telerik:UriImageProvider GeoBounds="42.786, 23.17, 25, 14" Uri=file:///C:/Users/*****/Desktop/FloorMap.png/>
            </telerik:RadMap.Provider>
        </telerik:RadMap>
    </Grid>
</UserControl>

 

Petar Mladenov
Telerik team
 answered on 12 Aug 2016
1 answer
172 views
Re-styling the PropertyGridField style by setting the RadPropertyGrid.FieldStyle property will cause the RadPropertyGrid.OnFieldLoaded to be called twice for each property instead of once when no custom style is specified.
Stefan
Telerik team
 answered on 12 Aug 2016
2 answers
437 views

Hi!

I must use FontAwesome in Telerik GridView for WPF - does anyone know how to do it?

FontAwesome: http://fontawesome.io/

 

Beste regards to all!

m@rko

Stefan Nenchev
Telerik team
 answered on 12 Aug 2016
3 answers
389 views
Hi telerik,

I have 2 raddatepicker which are STARTDATE and ENDDATE. My business logic constraint is START DATE must less or equal to END DATE. Now, I'm using SelectableDateStart and SelectableDateEnd property to validate selected date and it works fine. My problem is this method can't handle if user input Date by key-in.

How to disable "Key-in" function ?

My XAML :
<telerik:RadDatePicker x:Name="startDate" SelectableDateEnd="{Binding ElementName=endDate, Path=SelectedDate }" />
  
<telerik:RadDatePicker x:Name="endDate" SelectableDateStart="{Binding ElementName=startDate, Path=SelectedDate }" />

Please give me some advice , thank you

SweNz
Bairong
Top achievements
Rank 1
 answered on 11 Aug 2016
1 answer
75 views

Hi,

The line

RtbEditor.ChangeStyleName(style.Name, true);

Works perfectly when Track Changes is disabled. When it is enabled and there are tracked changes in the current paragraph, it works for the first time, but the next time it crashes with the exception

System.ArgumentNullException
Message "Value cannot be null.\r\nParameter name: owner"
   at Telerik.Windows.Documents.Model.Styles.DocumentElementPropertiesBase.SetDocumentElementOwner(DocumentElement owner)
   at Telerik.Windows.Documents.Model.Styles.ParagraphProperties.SetDocumentElementOwner(DocumentElement owner)
   at Telerik.Windows.Documents.Model.Styles.DocumentElementPropertiesBase..ctor(DocumentElement owner)
   at Telerik.Windows.Documents.Model.Styles.ParagraphProperties..ctor(DocumentElement owner)
   at Telerik.Windows.Documents.Model.Styles.ParagraphProperties.CreateInstance()
   at Telerik.Windows.Documents.Model.Styles.DocumentElementPropertiesBase.CopyPropertiesFrom(DocumentElementPropertiesBase fromProperties)
   at Telerik.Windows.Documents.Model.Styles.ParagraphProperties.CopyPropertiesFrom(DocumentElementPropertiesBase fromProperties)
   at Telerik.Windows.Documents.Commands.Styles.Paragraphs.ClearParagraphFormattingCommand.GetPropertyValue(Paragraph paragraph)
   at Telerik.Windows.Documents.Commands.Styles.Paragraphs.ChangeParagraphStyleCommandBase`2.PreserveStateBeforeExecute(TContext context)
   at Telerik.Windows.Documents.Commands.UndoableDocumentCommandBase`1.OnExecuting(DocumentCommandContextBase context)
   at Telerik.Windows.Documents.Commands.DocumentCommandBase`1.Execute(DocumentCommandContextBase context)
   at Telerik.Windows.Documents.Model.RadDocumentEditor.ExecuteChangeStyleNameCommand(StyleType type, String styleName)
   at Telerik.Windows.Documents.Model.RadDocumentEditor.ChangeStyleName(String styleName, Boolean useLinkedStyle)
   at Telerik.Windows.Controls.RadRichTextBox.ChangeStyleName(String styleName, Boolean useLinkedStyle)

 

I've made a workaround

var spanstyle = style.LinkedStyle;
var selection = RtbEditor.Document.Selection;
if (!selection.IsEmpty)
    foreach (var span in selection.GetSelectedBoxes<SpanLayoutBox>().Select(x => x.AssociatedSpan).Distinct().ToList())
        span.Style = spanstyle;
else
{
    var paragraph = RtbEditor.Document.CaretPosition.GetCurrentParagraphBox().AssociatedParagraph;
    if (paragraph != null)
        foreach (var span in paragraph.Inlines.OfType<Span>().ToList())
            span.Style = spanstyle;
}

 

And it seams to be working, but it is kind of hacking.

 

I'm using version 2016.1.112.45 and haven't tested with the latest one as I don't have time to test if everything else works after the upgrade.

 

Regards,

Daniel

 

 

Tanya
Telerik team
 answered on 11 Aug 2016
1 answer
476 views

Hi Telerik,

    We've got unhandled exception in yours sources.

    After applying filters for GridView which filter all existed items (with using ObservableCollection) we get such stack trace list:

01.System.Transactions Critical: 0 :
02.<TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Critical">
04.    <Description>Unhandled exception</Description>
05.    <AppDomain>TimeTracking.Client.vshost.exe</AppDomain>
06.    <Exception>
07.        <ExceptionType>System.ArgumentException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
08.        <Message>Source type must be an enumerable type.</Message>
09.        <StackTrace>   at Telerik.Windows.Data.Expressions.EnumerableFilterOperatorExpressionBuilder.GenerateContainsMethodCall(Expression source, Expression value, Boolean shouldNegate)
10.   at Telerik.Windows.Data.Expressions.OperatorValueFilterDescriptorExpressionBuilderBase.CreateBodyExpression()
11.   at Telerik.Windows.Data.Expressions.FilterDescriptorCollectionExpressionBuilder.CreateBodyExpression()
12.   at Telerik.Windows.Data.Expressions.FilterDescriptorCollectionExpressionBuilder.CreateBodyExpression()
13.   at Telerik.Windows.Data.Expressions.FilterDescriptorCollectionExpressionBuilder.CreateBodyExpression()
14.   at Telerik.Windows.Data.Expressions.FilterExpressionBuilder.CreateFilterExpression()
15.   at Telerik.Windows.Data.QueryableExtensions.Where(IQueryable source, CompositeFilterDescriptorCollection filterDescriptors)
16.   at Telerik.Windows.Data.QueryableCollectionView.CreateView()
17.   at Telerik.Windows.Data.QueryableCollectionView.CreateInternalList()
18.   at Telerik.Windows.Data.QueryableCollectionView.get_InternalList()
19.   at Telerik.Windows.Data.QueryableCollectionView.get_InternalCount()
20.   at Telerik.Windows.Data.QueryableCollectionView.get_IsEmpty()
21.   at Telerik.Windows.Data.QueryableCollectionView.InitializeCurrencyOnRefresh(CurrencyRefreshInfo currencyRefreshInfo)
22.   at Telerik.Windows.Data.QueryableCollectionView.RefreshOrDefer()
23.   at Telerik.Windows.Data.QueryableCollectionView.InvalidatePagingAndRefresh()
24.   at Telerik.Windows.Data.QueryableCollectionView.OnFilterDescriptorsChanged()
25.   at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
26.   at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
27.   at Telerik.Windows.Data.ObservableItemCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
28.   at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)
29.   at System.Collections.ObjectModel.Collection`1.System.Collections.IList.Add(Object value)
30.   at Telerik.Windows.Data.CollectionHelper.Equalize(IList left, IList right, IEqualityComparer comparer)
31.   at Telerik.Windows.Data.DataItemCollection.EqualizeFilterDescriptors()
32.   at Telerik.Windows.Data.DataItemCollection.EqualizeDescriptors()
33.   at Telerik.Windows.Data.DataItemCollection.set_CollectionView(QueryableCollectionView value)
34.   at Telerik.Windows.Data.DataItemCollection.CreateAndSetCollectionView(IEnumerable source, Type type)
35.   at Telerik.Windows.Data.DataItemCollection.SetItemsSource(IEnumerable source, Type type)
36.   at Telerik.Windows.Controls.GridView.GridViewDataControl.&lt;&gt;c__DisplayClass20.&lt;Bind&gt;b__1f()
37.   at Telerik.Windows.Controls.CursorManager.PerformTimeConsumingOperation(FrameworkElement frameworkElement, Action action)
38.   at Telerik.Windows.Controls.GridView.GridViewDataControl.OnApplyTemplate()
39.   at System.Windows.FrameworkElement.ApplyTemplate()
40.   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
41.   at System.Windows.UIElement.Measure(Size availableSize)
42.   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
43.   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean&amp; hasDesiredSizeUChanged)
44.   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
45.   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
46.   at System.Windows.UIElement.Measure(Size availableSize)
47.   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
48.   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
49.   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
50.   at System.Windows.UIElement.Measure(Size availableSize)
51.   at System.Windows.ContextLayoutManager.UpdateLayout()
52.   at System.Windows.Controls.TabItem.OnPreviewGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
53.   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
54.   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
55.   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
56.   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
57.   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
58.   at System.Windows.Input.InputManager.ProcessStagingArea()
59.   at System.Windows.Input.KeyboardDevice.TryChangeFocus(DependencyObject newFocus, IKeyboardInputProvider keyboardInputProvider, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
60.   at System.Windows.Input.KeyboardDevice.Focus(DependencyObject focus, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
61.   at System.Windows.Input.KeyboardDevice.Focus(IInputElement element)
62.   at System.Windows.UIElement.Focus()
63.   at System.Windows.Controls.TabItem.SetFocus()
64.   at System.Windows.Controls.TabItem.OnMouseLeftButtonDown(MouseButtonEventArgs e)
65.   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
66.   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
67.   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
68.   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
69.   at System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e)
70.   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
71.   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
72.   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
73.   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
74.   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
75.   at System.Windows.Input.InputManager.ProcessStagingArea()
76.   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
77.   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
78.   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean&amp; handled)
79.   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean&amp; handled)
80.   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean&amp; handled)
81.   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
82.   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
83.   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
84.   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
85.   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr...

Please, suggest a direction or a clue based on the stack trace which can lead me to the problem or it's solution?

Thank you!

Vasiliy
Top achievements
Rank 1
 answered on 11 Aug 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
+? 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?