Telerik Forums
UI for WPF Forum
1 answer
248 views
I got exception - Parameter count mismatch on setting RadDataForm's currentItem if INotifyPropertyChanged has been implemented and an Indexer[e.g IDataErrorInfo has been implemented] is used in that that data source. Control version is : 2012.3.1129.40 [2012 Q3 SP1].

Message : Parameter count mismatch.

Here is details stack trace :
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
   at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index)
   at Telerik.Windows.Data.ItemPropertyInfoExtensions.GetValue(ItemPropertyInfo itemProperty, Object item)
   at Telerik.Windows.Controls.RadDataForm.PopulatePropertiesInitialValues(Object currentItem)
   at Telerik.Windows.Controls.RadDataForm.OnCurrentItemChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp)
   at System.Windows.Data.BindingExpressionBase.Invalidate(Boolean isASubPropertyChange)
   at System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange)
   at System.Windows.Data.BindingExpression.Activate(Object item)
   at System.Windows.Data.BindingExpression.OnDataContextChanged(DependencyObject contextElement)
   at System.Windows.Data.BindingExpression.HandlePropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args)
   at System.Windows.Data.BindingExpressionBase.OnPropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args)
   at System.Windows.Data.BindingExpression.OnPropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args)
   at System.Windows.DependentList.InvalidateDependents(DependencyObject source, DependencyPropertyChangedEventArgs sourceArgs)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.TreeWalkHelper.OnInheritablePropertyChanged(DependencyObject d, InheritablePropertyChangeInfo info)
   at System.Windows.DescendentsWalker`1._VisitNode(DependencyObject d)
   at System.Windows.DescendentsWalker`1.VisitNode(FrameworkElement fe)
   at System.Windows.DescendentsWalker`1.VisitNode(DependencyObject d)
   at System.Windows.DescendentsWalker`1.WalkLogicalChildren(FrameworkElement feParent, FrameworkContentElement fceParent, IEnumerator logicalChildren)
   at System.Windows.DescendentsWalker`1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren)
   at System.Windows.DescendentsWalker`1.IterateChildren(DependencyObject d)
   at System.Windows.DescendentsWalker`1.StartWalk(DependencyObject startNode, Boolean skipStartNode)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   at System.Windows.FrameworkElement.set_DataContext(Object value)
   at JerichoListsManagement.View.AddView.set_ViewModel(IViewModel value) in D:\JerichoLatest\src\GUI\WPF UI\Module\JerichoListsManagement\View\AddView.xaml.cs:line 19
   at JerichoListsManagement.ViewModel.PatientViewModel.ExecuteAddEntityCommand() in D:\JerichoLatest\src\GUI\WPF UI\Module\JerichoListsManagement\ViewModel\PatientViewModel.cs:line 108
   at Microsoft.Practices.Prism.Commands.DelegateCommand.<>c__DisplayClass6.<.ctor>b__2(Object o)
   at Microsoft.Practices.Prism.Commands.DelegateCommandBase.Execute(Object parameter)
   at Microsoft.Practices.Prism.Commands.DelegateCommandBase.System.Windows.Input.ICommand.Execute(Object parameter)
   at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
   at System.Windows.Controls.Primitives.ButtonBase.OnClick()
   at System.Windows.Controls.Button.OnClick()
   at Telerik.Windows.Controls.RadButton.OnClick()
   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

 
Ivan Ivanov
Telerik team
 answered on 20 Dec 2012
1 answer
117 views
I have a user control which is just a RadGrid. But the grid is huge where it has 50 columns and for rows i guess not much but 100 rows  and the issue is the same for 20 rows. Where i change the main content or show and hide or drag out and drag it back in it takes a long time and makes pauses while docking or docking out. 


Is there any way i can reduce this pause or any workaround for this issue.
Miroslav Nedyalkov
Telerik team
 answered on 20 Dec 2012
1 answer
554 views
I'm encountering an exception when I call Application.Current.Shutdown in my app. The exception is:

Message
"Cannot set Visibility to Visible or call Show, ShowDialog, Close, or WindowInteropHelper.EnsureHandle while a Window is closing."

Stacktrace
at System.Windows.Window.VerifyNotClosing()
at System.Windows.Window.InternalClose(Boolean shutdown, Boolean ignoreCancel)
at System.Windows.Window.Close()
at Telerik.Windows.Controls.InternalWindow.WindowWithNoChromeWindowHost.Close() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Window\InternalWindow\WindowWithNoChromeWindowHost.cs:line 54
at Telerik.Windows.Controls.WindowBase.CloseHostImidiately() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Window\WindowBase.cs:line 1333
at Telerik.Windows.Controls.WindowBase.OnCloseAnimationFinished() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Window\WindowBase.cs:line 1025
at Telerik.Windows.Controls.WindowBase.PlayCloseAnimation() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Window\WindowBase.cs:line 1318
at Telerik.Windows.Controls.WindowBase.TryClose(Boolean shouldCloseHost) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Window\WindowBase.cs:line 719
at Telerik.Windows.Controls.WindowBase.Telerik.Windows.Controls.InternalWindow.IWindowDragAware.TryClose(Boolean shouldCloseHost) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Window\WindowBase.cs:line 612
at Telerik.Windows.Controls.InternalWindow.WindowWithNoChromeWindowHost.OnWindowClosing(Object sender, CancelEventArgs e) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Window\InternalWindow\WindowWithNoChromeWindowHost.cs:line 277
at System.Windows.Window.OnClosing(CancelEventArgs e)
at System.Windows.Window.InternalClose(Boolean shutdown, Boolean ignoreCancel)

For what it's worth, this app uses Prism and this is a call made via an ICommand on the Shell's viewmodel. As such:

ShellViewModel.cs (snippet)
/// <summary>
/// Gets the exit command.
/// </summary>
public ICommand ExitCommand
{
    get
    {
        return new DelegateCommand(() =>
            {
                // If we can close, do so...
                if (this.CanClose)
                {
                    Application.Current.Shutdown();
                }
            });
    }
}

Without over-complicating matters, the CanClose property is implemented by each screen in the application and will raise a RadWindow dialog prompting for confirmation if there are changes on that screen. Based on our implementation, all of that prompting should be complete before the Application.Current.Shutdown is called so we're not sure what's happening and we can't seem to catch this exception anywhere. It feels like it might be a race condition, but we're not sure where.

Any ideas?

Greg
Vladi
Telerik team
 answered on 20 Dec 2012
3 answers
160 views
I am using dynamic layers to retrieve data depending on the zoom level and it's working great. However, the user would like to be able to hide certain map pins by checking a show/hide checkbox on the form.

Is it possible to hide items on a dynamic layer? Or even set the visibility of the layer?

I did think about refreshing it's datasource but I cannot find a way to force the map to rebind, I could move the map center programmatically which would cause the ItemsRequest to fire but that seems like a hack.

Is there a way to force a rebind of the data or hide the pins?

Many thanks,
Mark

Andrey
Telerik team
 answered on 20 Dec 2012
1 answer
168 views
Hello!
  I set the property of IsEditable to the TreeViewItem,but it not work,the code:
why the header=2222222,press F2 not work?

<Telerik:RadTreeView IsLineEnabled="True" FontWeight="Normal">
            <Telerik:RadTreeViewItem Header="1111" IsExpanded="True" IsEditable="True">
                <Telerik:RadTreeViewItem Header="22222222222" IsSelected="True" IsEditable="True" >
                </Telerik:RadTreeViewItem>
                <Telerik:RadTreeViewItem Header="33333333333">
                </Telerik:RadTreeViewItem>
                <Telerik:RadTreeViewItem Header="44444444444">
                </Telerik:RadTreeViewItem>
            </Telerik:RadTreeViewItem>
        </Telerik:RadTreeView>
Pavel R. Pavlov
Telerik team
 answered on 20 Dec 2012
3 answers
231 views
Hello,

i would like to use the WPF Richtextbox to display some "News" inside our Application.
This News can be different in size, so i need to split the text to different pages, like in Layoutmode "paged".
But also i would like to display only one page at once.
--> Show Page 1 , Blendover, Show Page 2

The best wold be if i can get the different Pages without this "Page" Style around.

So in short:

I need the Documentsplitting from Paged layoutmode, and the clean View from Flow layoutmode, and get / scrollto the different Pages.

I hope you can give ne an Idea how to perform this.

Best Regards,

Michael Rummel,
heinekingmedia GmbH
Petya
Telerik team
 answered on 20 Dec 2012
1 answer
158 views
I was having a problem, and was going to post asking for help, but I figured it out. And then thought I might post about the problem I ran into, and the solution, in case someone else runs into it.

I have a user control that contains a RadDataForm and a RadGridView, both of which have their ItemsSource properties bound to a QueryableCollectionView that is wrapped around an ObservableItemCollection.

And I have a "New" button that is bound to a command that calls RadDataForm.AddNewItem().

The objects in the collection were instances of a ORM record class, and the fields in the form and the the grid were bound to properties of the record class, and all was well and good.

Until I decided that I needed to add additional validation. I couldn't modify the record class - it is shared across several projects - so I did what I have often done, I defined a new wrapper class. The constructor for the new wrapper class took a an instance of the record class as an argument, and exposed it as a property (and also exposed the additional functionality I needed.)

So I modified the collection to contain instances of this wrapper class, and modified the bindings to properties of the record class property of the wrapper, instead of to properties of the record class itself.  And then ran the program to see how it would do.

The grid displayed fine, and the form viewed existing records fine. But when I clicked my "New" button, AddNewItem() returned false.

This confused me. I could see how this would happen, if ItemsSource was bound to a fixed-size array, but I should be able to insert new items into a ObservableItemCollection.

The problem turned out to be the constructor of the wrapper class. It seems the element type in the collection must have a zero-argument constructor. Once I added this, everything worked again.
Maya
Telerik team
 answered on 20 Dec 2012
2 answers
441 views
My scenario is fairly simple: I have a grid bound to a VirtualQueryableCollectionView that is loaded with DataRows. Each DataRow has a column containing an integer value for a color that I need to convert to a SolidColorBrush. I'm specifying the RadGridView.RowStyle and an IValueConverter to achieve the setting of the row background. The problem I'm seeing is that my converter is only called one time with a row that actually contains a DataRow for it's 'Item' property. That single call is for the row just out of view in the grid. None of the visible rows before it contain a DataRow as their GridViewRow.Item.

Here is my style attached to the grid:

<telerik:RadGridView.RowStyle>
                <Style TargetType="telerik:GridViewRow">
                    <Setter Property="Background">
                        <Setter.Value>
                            <Binding RelativeSource="{RelativeSource Self}" Converter="{StaticResource DataGridRowBackgroundConverter}" ></Binding>
                        </Setter.Value>
                    </Setter>
                </Style>
            </telerik:RadGridView.RowStyle>


And here is the converter code. Note the comment on line 4:

public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var gridViewRow = (GridViewRow)value;
            var dataRow = gridViewRow.Item as DataRow;  // This is only true for a single row in the grid!
            if (dataRow == null) return new SolidColorBrush(Colors.Transparent);

            var integerValue = dataRow.Field<int>(DataSourceConstants.ColorColumnName);
            if (integerValue == 0)
            {
                return new SolidColorBrush(Colors.Transparent);
            }

            var bytes = BitConverter.GetBytes(integerValue);
            var color = Color.FromArgb(bytes[3], bytes[2], bytes[1], bytes[0]);

            return new SolidColorBrush(color);
        }



What could I be doing wrong here?
kilhoffer
Top achievements
Rank 1
 answered on 19 Dec 2012
1 answer
192 views
Hello!
the project as the attach picture. When I click on the Create button continuously to creat document,after that, I press F2 to edit documents created, the results of the edit box is empty,why? the problem as the 3.png of the attach file. But after I created the file, use the mouse to click in the edit box next to,as the 1.png attach file, There is no the problem. The mouse does not click elsewhere, always click the Create button, Is previously created file will be the CancelEdit ()?

the xaml code:
When I create the new document, I will set the IsInEditMode=true, and I use MVVM
<UserControl.Resources>
<DataTemplate x:Key="childrenDocument">
<StackPanel Orientation="Horizontal">
<Image Width="24" Height="24" Source="/Fujitsu.iDM.View.Impl;component/Icons/128/image-folder.png"></Image>
<TextBlock Text="{Binding Name, Mode=TwoWay}" />
</StackPanel>
</DataTemplate>
<HierarchicalDataTemplate x:Key="rootDocument" ItemsSource="{Binding Mode=TwoWay, Path=ChildrenDocuments}"
ItemTemplate="{StaticResource childrenDocument}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Name, Mode=TwoWay}"/>
</StackPanel>
</HierarchicalDataTemplate>
<Style x:Key="treeViewItemStyle" TargetType="telerik:RadTreeViewItem">
<Setter Property="IsInEditMode" Value="{Binding IsInEditMode, Mode=TwoWay}" />
<Setter Property="IsSelected" Value="{Binding IsSelected}" />
<Setter Property="IsExpanded" Value="true" />
</Style>
</UserControl.Resources>
<StackPanel>
<telerik:RadTreeView x:Name="radTreeNav" PreviewSelectionChanged="RadTreeView_PreviewSelectionChanged" IsEditable="true" FontWeight="Normal"
SelectedItem="{Binding NavBarSelectedDocument, Mode=OneWayToSource}" ItemContainerStyle="{StaticResource treeViewItemStyle}"
IsLineEnabled="True" ItemTemplate="{StaticResource rootDocument}" ItemsSource="{Binding RootDocuments}" >
<telerik:RadTreeView.ItemEditTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Image Width="24" Height="24" Source="/Fujitsu.iDM.View.Impl;component/Icons/128/image-folder.png"></Image>
<TextBox Text="{Binding Path=Name, Mode=TwoWay}"/>
</StackPanel>
</DataTemplate>
</telerik:RadTreeView.ItemEditTemplate>
</telerik:RadTreeView>
</StackPanel>
Pavel R. Pavlov
Telerik team
 answered on 19 Dec 2012
1 answer
142 views
Hello Telerik team!.
I have 2 problems with radchart (currently i'm using Telerik.Web.UI version 2012.3.1016.35 with SharePoint 2013).
Users will be asked a survey question and choose their answers then click "Vote" button after that the radchart (Pie chart) will be display results.
Here is my issues: 
1. The rad chart always keep the previous results. If i pressed Ctrl + F5 or F5  the new results is updated. It only happened on IE 9 (good working on IE 8).
2. When anynomous user answer survey question, the radchart can't display and i received error:
'The Visible property cannot be set on Web Part 'g_49646826_5f92_4fb2_9e3a_e5059f7fcbe5'.  It can only be set on a standalone Web Part.'
I googled and found some instruction links how to fix, it's related to webpart property (Webpart.Visible=false, ...) but i didn't use it in my code.
Can anyone help me how to fix this!?
Thanks in advance!.
Evgenia
Telerik team
 answered on 19 Dec 2012
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?