Telerik Forums
UI for WPF Forum
1 answer
236 views
I am having an issue with trying to create a navigation control that will change the currently displayed item and I am hoping that someone can point me the in the right direction.  Here is the setup:

We have a RadTabControl with two tabs -- one for the RadGridView which is binding to an ObservableCollection dependency property and the second tab is a DetailsPresenter.  When the user double clicks on the row, the tab page switches to the second one with the row details in the details presenter.  All that is working perfectly.

Our vision was to create next/prev buttons at the bottom of the tab with the details presenter in order allow the user to scroll next/prev without flipping back to the grid's tab to make the change.  However, calling the MoveCurrentToNext() routine on the Items collection of the RadGridView is throwing an error:

"Argument types do not match" with the following stack trace:
   at System.Linq.Expressions.Expression.Constant(Object value, Type type)     at Telerik.Windows.Data.QueryableCollectionView.MoveCurrentToPositionCore(Int32 position) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.Currency.cs:line 102     at Telerik.Windows.Data.QueryableCollectionView.MoveCurrentToPosition(Int32 position) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.Currency.cs:line 93     at Telerik.Windows.Data.QueryableCollectionView.MoveCurrentToNext() in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.Currency.cs:line 65     at Telerik.Windows.Data.DataItemCollection.MoveCurrentToNext() in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\DataItemCollection.ICollectionView.cs:line 482     at KnightSoftware.KIP.RoutePanels.InventoryMaintenance.NextRecord_Click(Object sender, RoutedEventArgs e) in D:\My Documents\Visual Studio 2010\Projects\KIP Software Suite\Source Code\KIP Inventory System Panels\InventoryMaintenance.xaml.cs:line 480     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.RaiseEvent(RoutedEventArgs e)     at System.Windows.Controls.Primitives.ButtonBase.OnClick()     at System.Windows.Controls.Button.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)

BTW, this is the first item in a collection of 10, no grouping or specific sorting set.

Anything obvious to look at that I could be doing?  I can try to reproduce the error in a separate project but was hoping that I could simply be missing setting a type or setting or such.

Thanks,
Adam
Yordanka
Telerik team
 answered on 15 Jun 2011
5 answers
1.0K+ views
Hi,
I have (randomly) this kind of problem in my application:

when I load the Window containing the telerik Chart control ("WindowChart") the app crashes with this kind of error:
"Specified value of type 'System.Windows.Media.SolidColorBrush' must have IsFrozen set to false to modify."

It doesn't happen when "WindowChart" is the First window loaded.
If I load other windows before (all containing other telerik controls - not chart) - only in some cases, but always loading "WindowChart" - the App crashes

can you help me?

Michele Semprini
Ves
Telerik team
 answered on 15 Jun 2011
3 answers
224 views
Hi,

We have a problem with the grid filters when using the IsFilterable property.

Here are the steps:

1. we select a ColumnFilter using the small icon on top of the column - the filtered records appear.
2. we select several records from this filtered list
3. we change the filter to any other of which output does not contain the previously selected records.

At this moment the selection we made is cleared leaving us with SelectedItems.Count == 0. Therefore we cannot use filters more then once to select records from different categories.

Please supply solution to this issue.
Rossen Hristov
Telerik team
 answered on 15 Jun 2011
1 answer
110 views

Hi Telerik,

I am using “RadDateTimePicker” with InputMode="DatePicker". I want to open a calendar with future dates when user click on calendar icon. By default, current months are opening with respective dates, but I want to set future date in order that calendar popup will open as per the future date/month.

 

Thanks,

Dinesh

Konstantina
Telerik team
 answered on 15 Jun 2011
1 answer
256 views
Hi,

I'm trying to create a custom column that inherits from GridViewBoundColumnBase but I want to style it entirely in XAML.

I need to know how to do the binding between the column's DataMemberBinding and the editor.

Here is a simple example (the GridViewColumnTextBox is empty and inherit's GridViewBoundColumnBase):

        <Style TargetType="{x:Type Controles:GridViewColumnTextBox}">
            <Setter Property="CellEditTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <TextBox Text="BINDING?"/>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>

So, is there any way to do the binding to DataMemberBinding ?
Pavel Pavlov
Telerik team
 answered on 15 Jun 2011
8 answers
532 views
TypeA & TypeB both implement the same base type.  We are binding the RadGridView's ItemSource to an IList<BaseType> baseList

When we have the grid view filtering out TypeA and re-generate our baseList object, the on property changed throws the following:

As a note, we are using a custom hierarchy (as found in the examples: Telerik\RadControls for WPF Q1 2011 SP1\Demos\Examples\GridView\Hierarchy\CustomHierarchy)
-Type B has a list of TypeA,
-only TypeB is expandable (to show list of TypeA).

System.InvalidCastException: Unable to cast object of type 'TypeA' to type 'TypeB'.
   at System.Linq.Enumerable.<CastIterator>d__aa`1.MoveNext()
   at Telerik.Windows.Data.QueryableCollectionView.PopulateInternalList(IQueryable view)
   at Telerik.Windows.Data.QueryableCollectionView.CreateInternalList()
   at Telerik.Windows.Data.QueryableCollectionView.EnsureInternalList()
   at Telerik.Windows.Data.QueryableCollectionView.get_InternalList()
   at Telerik.Windows.Data.QueryableCollectionView.InternalIndexOf(Object item)
   at Telerik.Windows.Data.QueryableCollectionView.TryRestorePreviousCurrency()
   at Telerik.Windows.Data.QueryableCollectionView.InitializeCurrencyOnRefresh()
   at Telerik.Windows.Data.QueryableCollectionView.RefreshOverride()
   at Telerik.Windows.Data.QueryableCollectionView.RefreshInternal()
   at Telerik.Windows.Data.QueryableCollectionView.RefreshOrDefer()
   at Telerik.Windows.Data.QueryableCollectionView.InvalidatePagingAndRefresh()
   at Telerik.Windows.Data.QueryableCollectionView.OnFilterDescriptorsCollectionChanged(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.RemoveItem(Int32 index)
   at Telerik.Windows.Data.RadObservableCollection`1.RemoveItem(Int32 index)
   at System.Collections.ObjectModel.Collection`1.Remove(T item)
   at Telerik.Windows.Data.CollectionExtensions.RemoveItems[T](ICollection`1 collection, IEnumerable`1 items)
   at Telerik.Windows.Data.DataItemCollection.RemoveDescriptorsFromCollectionView()
   at Telerik.Windows.Data.DataItemCollection.set_CollectionView(QueryableCollectionView value)
   at Telerik.Windows.Data.DataItemCollection.CreateCollectionView(IEnumerable source)
   at Telerik.Windows.Data.DataItemCollection.SetItemsSource(IEnumerable source)
   at Telerik.Windows.Controls.GridView.GridViewDataControl.<>c__DisplayClass18.<Bind>b__17()
   at Telerik.Windows.Controls.CursorManager.PerformTimeConsumingOperation(FrameworkElement frameworkElement, Action action)
   at Telerik.Windows.Controls.GridView.GridViewDataControl.Bind(Object newValue)
   at Telerik.Windows.Controls.GridView.GridViewDataControl.OnItemsSourceChanged(Object oldValue, Object newValue)
   at Telerik.Windows.Controls.DataControl.OnItemsSourcePropertyChanged(DependencyObject origin, 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, OperationType operationType)
   at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp)
   at System.Windows.Data.BindingExpression.Invalidate(Boolean isASubPropertyChange)
   at System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange)
   at System.Windows.Data.BindingExpression.ScheduleTransfer(Boolean isASubPropertyChange)
   at MS.Internal.Data.ClrBindingWorker.NewValueAvailable(Boolean dependencySourcesChanged, Boolean initialValue, Boolean isASubPropertyChange)
   at MS.Internal.Data.PropertyPathWorker.UpdateSourceValueState(Int32 k, ICollectionView collectionView, Object newValue, Boolean isASubPropertyChange)
   at MS.Internal.Data.ClrBindingWorker.OnSourcePropertyChanged(Object o, String propName)
   at MS.Internal.Data.PropertyPathWorker.System.Windows.IWeakEventListener.ReceiveWeakEvent(Type managerType, Object sender, EventArgs e)
   at System.Windows.WeakEventManager.DeliverEventToList(Object sender, EventArgs args, ListenerList list)
   at System.ComponentModel.PropertyChangedEventManager.OnPropertyChanged(Object sender, PropertyChangedEventArgs args)
   at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
   at OurCode.NotifyPropertyChanged[T](Expression`1 propertySelector) in [Our stack trace here...]
Yavor Georgiev
Telerik team
 answered on 15 Jun 2011
1 answer
102 views
Hi,

I tried to add combox to one of the column header in my TreeListView as below, but it doesn't work.

 

<telerik:GridViewDataColumn  DataMemberBinding="{Binding UnweightedCount, Mode=OneWay}">
    <telerik:GridViewColumn.Header>
        <DataTemplate>
            <ComboBox >
                <ComboBoxItem  Name="cbi1">Item1</ComboBoxItem>
                <ComboBoxItem  Name="cbi2">Item2</ComboBoxItem>
                <ComboBoxItem  Name="cbi3">Item3</ComboBoxItem>
            </ComboBox>
        </DataTemplate>
    </telerik:GridViewColumn.Header>
</telerik:GridViewDataColumn>
 

By the way, I was going to attach some pictures, I couldn't find attach button when I edit this thread.

Regarding,

Fendy
Vlad
Telerik team
 answered on 15 Jun 2011
1 answer
99 views
I am trying to use a CellEditTemplate to define a RadDatePicker on a GridView cell. Reason for this is that I want to control the Selectable Dates, so the user cannot select a date after today. It is partially working.

I've defined a TextBlock as the CellTemplate and the RadDatePicker as the CellEditTemplate. But when I select a date and move to the next cell, it's not updating the value in the view mode for that cell.

I'm sure I'm missing something to make this work. How do I define a RadDatePicker as teh CellEditTemplate on a GridViewDataColumn bound to a property on my VM?
Rayne
Top achievements
Rank 1
 answered on 14 Jun 2011
0 answers
163 views
I'm setting my textbox to pick up the application theme and for a few of my controls, I need to remove the right rounded corners.

I'm basically trying to make a DropDownButton look sort of like an editable comboBox. I've got it working with the exception of the corner radius of the styled textbox. If I give the right side a border thickness of 1 so that it divides the text area from teh dropdown button, then the corners on that side show up.

How do I remove the corner radius from the right side just for these specific textboxes?
Rayne
Top achievements
Rank 1
 asked on 14 Jun 2011
3 answers
892 views
I'm using a drop down button to display a context menu of options. But I'd like the content of the button to appear as a TextBox (like an editable combobox, but read-only). Is this possible?

If not, can I at least left align the text that gets displayed? I'm using a ContentTemplate and setting HorizontalAlignment and TextAlignment to Left on the TextBlock, but it still is aligning to the center of the control.

Essentially I want it to look like an editable combobox (with a textbox and dropdown button to the side; textbox can look disabled/read-only).
Rayne
Top achievements
Rank 1
 answered on 14 Jun 2011
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
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
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
VirtualKeyboard
HighlightTextBlock
Security
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?