Telerik Forums
UI for WPF Forum
4 answers
172 views
Am about to completely backout the upgrade of my Telerik controls from 2010 Q3 to 2011 Q1, way too many problems.

One of the problems is the eror below when clicking on a hyperlink I have in a CellTemplate in a grid.  I don't know if the problem is in the grid or the tab control since the grid is housed in a usercontrol which is shown in a tab control.  I'm having tons of issues with the tab control as well.

<telerik:RadGridView Name="sourcegrid" Grid.Row="1" ItemsSource="{Binding Items}" AutoGenerateColumns="False" IsReadOnly="True" SelectionMode="Single" 
                         SelectedItem="{Binding SelectedItem, Mode=TwoWay}" ContextMenu="{StaticResource gridmenu}" IsBusy="{Binding IsLoading}">
      <telerik:RadGridView.Columns>
        <telerik:GridViewBoundColumnBase Header="Account Number" DataMemberBinding="{Binding AccountNumber}" ShowDistinctFilters="False" >
          <telerik:GridViewBoundColumnBase.CellTemplate>
            <DataTemplate>
              <TextBlock><Hyperlink Command="{Binding DataContext.SelectCommand, RelativeSource={RelativeSource AncestorType={x:Type telerik:RadGridView}}}" CommandParameter="{Binding}"
                        <TextBlock Text="{Binding AccountNumber}"/>
                    </Hyperlink></TextBlock>
            </DataTemplate>
          </telerik:GridViewBoundColumnBase.CellTemplate>
          <telerik:GridViewBoundColumnBase.AggregateFunctions>
            <telerik:CountFunction Caption="Count:" />
          </telerik:GridViewBoundColumnBase.AggregateFunctions>
        </telerik:GridViewBoundColumnBase>
        <telerik:GridViewDataColumn Header="Account Name" DataMemberBinding="{Binding AccountName}" Width="*" ShowDistinctFilters="False"  FooterCellStyle="{StaticResource GridNoLinesFooterStyle}"/>
        <telerik:GridViewDataColumn Header="Association" DataMemberBinding="{Binding AssociationName}"  FooterCellStyle="{StaticResource GridNoLinesFooterStyle}"/>
        <telerik:GridViewDataColumn Header="Status" DataMemberBinding="{Binding AccountStatusName}"  FooterCellStyle="{StaticResource GridNoLinesFooterStyle}" />
      </telerik:RadGridView.Columns>
    </telerik:RadGridView>

System.InvalidOperationException was unhandled
  Message='System.Windows.Documents.Hyperlink' is not a Visual or Visual3D.
  Source=PresentationCore
  StackTrace:
       at MS.Internal.Media.VisualTreeUtils.AsVisual(DependencyObject element, Visual& visual, Visual3D& visual3D)
       at MS.Internal.Media.VisualTreeUtils.AsNonNullVisual(DependencyObject element, Visual& visual, Visual3D& visual3D)
       at System.Windows.Media.Visual.IsAncestorOf(DependencyObject descendant)
       at Telerik.Windows.Controls.TabControl.RadTabControlBase`1.UpdateFocusOnSelectionChange() in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\TabControl\RadTabControlBase.cs:line 193
       at Telerik.Windows.Controls.TabControl.RadTabControlBase`1.HandleSelectionChanged(IList removedItems, IList addedItems) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\TabControl\RadTabControlBase.cs:line 1025
       at Telerik.Windows.Controls.TabControl.RadTabControlBase`1.Selector_SelectionChanged(Object sender, SelectionChangedEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\TabControl\RadTabControlBase.cs:line 364
       at System.Windows.Controls.SelectionChangedEventArgs.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.RaiseEvent(RoutedEventArgs e)
       at System.Windows.Controls.Primitives.Selector.OnSelectionChanged(SelectionChangedEventArgs e)
       at System.Windows.Controls.Primitives.Selector.InvokeSelectionChanged(List`1 unselectedItems, List`1 selectedItems)
       at System.Windows.Controls.Primitives.Selector.SelectionChanger.End()
       at System.Windows.Controls.Primitives.Selector.SetSelectedHelper(Object item, FrameworkElement UI, Boolean selected)
       at System.Windows.Controls.Primitives.Selector.NotifyIsSelectedChanged(FrameworkElement container, Boolean selected, RoutedEventArgs e)
       at System.Windows.Controls.Primitives.Selector.OnSelected(Object sender, RoutedEventArgs e)
       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 Telerik.Windows.Controls.RadTabItem.NotifyOwnerAboutChangedSelection(Boolean newValue) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\TabControl\RadTabItem.cs:line 538
       at Telerik.Windows.Controls.RadTabItem.OnIsSelectedChanged(Boolean oldValue, Boolean newValue) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\TabControl\RadTabItem.cs:line 432
       at Telerik.Windows.Controls.RadTabItem.OnIsSelectedChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\TabControl\RadTabItem.Properties.cs:line 411
       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.StyleHelper.ApplyStyleOrTemplateValue(FrameworkObject fo, DependencyProperty dp)
       at System.Windows.StyleHelper.InvalidateContainerDependents(DependencyObject container, FrugalStructList`1& exclusionContainerDependents, FrugalStructList`1& oldContainerDependents, FrugalStructList`1& newContainerDependents)
       at System.Windows.StyleHelper.DoStyleInvalidations(FrameworkElement fe, FrameworkContentElement fce, Style oldStyle, Style newStyle)
       at System.Windows.StyleHelper.UpdateStyleCache(FrameworkElement fe, FrameworkContentElement fce, Style oldStyle, Style newStyle, Style& styleCache)
       at System.Windows.FrameworkElement.OnStyleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
       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.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
       at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
       at System.Windows.Controls.ItemsControl.ApplyItemContainerStyle(DependencyObject container, Object item)
       at System.Windows.Controls.ItemsControl.MS.Internal.Controls.IGeneratorHost.PrepareItemContainer(DependencyObject container, Object item)
       at System.Windows.Controls.ItemContainerGenerator.System.Windows.Controls.Primitives.IItemContainerGenerator.PrepareItemContainer(DependencyObject container)
       at System.Windows.Controls.Panel.AddChildren(GeneratorPosition pos, Int32 itemCount)
       at System.Windows.Controls.Panel.OnItemsChangedInternal(Object sender, ItemsChangedEventArgs args)
       at System.Windows.Controls.Panel.OnItemsChanged(Object sender, ItemsChangedEventArgs args)
       at System.Windows.Controls.ItemContainerGenerator.OnItemAdded(Object item, Int32 index)
       at System.Windows.Controls.ItemContainerGenerator.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
       at System.Windows.Controls.ItemContainerGenerator.System.Windows.IWeakEventListener.ReceiveWeakEvent(Type managerType, Object sender, EventArgs e)
       at System.Windows.WeakEventManager.DeliverEventToList(Object sender, EventArgs args, ListenerList list)
       at System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
       at System.Collections.Specialized.CollectionChangedEventManager.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
       at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
       at System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
       at System.Windows.Controls.ItemCollection.System.Windows.IWeakEventListener.ReceiveWeakEvent(Type managerType, Object sender, EventArgs e)
       at System.Windows.WeakEventManager.DeliverEventToList(Object sender, EventArgs args, ListenerList list)
       at System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
       at System.Collections.Specialized.CollectionChangedEventManager.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
       at System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
       at MS.Internal.Controls.InnerItemCollectionView.Insert(Int32 index, Object item)
       at System.Windows.Controls.ItemCollection.Insert(Int32 insertIndex, Object insertItem)
       at Microsoft.Practices.Prism.Regions.Behaviors.SelectorItemsSourceSyncBehavior.Views_CollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) in c:\release\WorkingDir\PrismLibraryBuild\PrismLibrary\Desktop\Prism\Regions\Behaviors\SelectorItemsSourceSyncBehavior.cs:line 95
       at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
       at Microsoft.Practices.Prism.Regions.ViewsCollection.OnCollectionChanged(NotifyCollectionChangedEventArgs e) in c:\release\WorkingDir\PrismLibraryBuild\PrismLibrary\Desktop\Prism\Regions\ViewsCollection.cs:line 124
       at Microsoft.Practices.Prism.Regions.ViewsCollection.NotifyAdd(IList items, Int32 newStartingIndex) in c:\release\WorkingDir\PrismLibraryBuild\PrismLibrary\Desktop\Prism\Regions\ViewsCollection.Desktop.cs:line 30
       at Microsoft.Practices.Prism.Regions.ViewsCollection.NotifyAdd(Object item) in c:\release\WorkingDir\PrismLibraryBuild\PrismLibrary\Desktop\Prism\Regions\ViewsCollection.cs:line 284
       at Microsoft.Practices.Prism.Regions.ViewsCollection.SourceCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) in c:\release\WorkingDir\PrismLibraryBuild\PrismLibrary\Desktop\Prism\Regions\ViewsCollection.cs:line 246
       at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
       at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
       at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)
       at System.Collections.ObjectModel.Collection`1.Add(T item)
       at Microsoft.Practices.Prism.Regions.Region.InnerAdd(Object view, String viewName, IRegionManager scopedRegionManager) in c:\release\WorkingDir\PrismLibraryBuild\PrismLibrary\Desktop\Prism\Regions\Region.cs:line 380
       at Microsoft.Practices.Prism.Regions.Region.Add(Object view, String viewName, Boolean createRegionManagerScope) in c:\release\WorkingDir\PrismLibraryBuild\PrismLibrary\Desktop\Prism\Regions\Region.cs:line 275
       at Bestpass.AM.Desktop.ScreenConductor.ShowChildScreen(ScreenActivateEventArgs param) in C:\Development\BestpassEM\Bestpass.Desktop\Classes\ScreenConductor.vb:line 63
       at Microsoft.Practices.Prism.Events.EventSubscription`1.InvokeAction(Action`1 action, TPayload argument) in c:\release\WorkingDir\PrismLibraryBuild\PrismLibrary\Desktop\Prism\Events\EventSubscription.cs:line 126
       at Microsoft.Practices.Prism.Events.EventSubscription`1.<>c__DisplayClass2.<GetExecutionStrategy>b__0(Object[] arguments) in c:\release\WorkingDir\PrismLibraryBuild\PrismLibrary\Desktop\Prism\Events\EventSubscription.cs:line 109
       at Microsoft.Practices.Prism.Events.EventBase.InternalPublish(Object[] arguments) in c:\release\WorkingDir\PrismLibraryBuild\PrismLibrary\Desktop\Prism\Events\EventBase.cs:line 71
       at Microsoft.Practices.Prism.Events.CompositePresentationEvent`1.Publish(TPayload payload) in c:\release\WorkingDir\PrismLibraryBuild\PrismLibrary\Desktop\Prism\Events\CompositePresentationEvent.cs:line 167
       at Bestpass.AM.UI.AccountManagement.ViewModels.AccountMaintenanceListViewModel.RequestShowAccountEdit(Int32 accountId) in C:\Development\BestpassEM\Bestpass.AM.Desktop.AccountManagement\ViewModel\CompanyAccount\AccountMaintenanceListViewModel.vb:line 182
       at Bestpass.AM.UI.AccountManagement.ViewModels.AccountMaintenanceListViewModel.ExecuteSelectCommand(vwCompanyAccount param) in C:\Development\BestpassEM\Bestpass.AM.Desktop.AccountManagement\ViewModel\CompanyAccount\AccountMaintenanceListViewModel.vb:line 177
       at Bestpass.UI.Infrastructure.WPF.RelayCommand`1.Execute(Object parameter) in C:\Development\BestpassEM\WPFInfrastructure\Infrastructure\RelayCommand.vb:line 78
       at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
       at System.Windows.Documents.Hyperlink.OnClick()
       at System.Windows.Documents.Hyperlink.DispatchNavigation(Object sender)
       at System.Windows.Documents.Hyperlink.DoUserInitiatedNavigation(Object sender)
       at System.Windows.Documents.Hyperlink.OnMouseLeftButtonUp(Object sender, MouseButtonEventArgs e)
       at System.Windows.Documents.Hyperlink.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.ContentElement.RaiseTrustedEvent(RoutedEventArgs args)
       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)
       at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.Run()
       at System.Windows.Application.RunDispatcher(Object ignore)
       at System.Windows.Application.RunInternal(Window window)
       at System.Windows.Application.Run(Window window)
       at System.Windows.Application.Run()
       at Bestpass.AM.Desktop.Application.Main() in C:\Development\BestpassEM\Bestpass.Desktop\obj\x86\Debug\Application.g.vb:line 72
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
       at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
       at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
       at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
       at System.Activator.CreateInstance(ActivationContext activationContext)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException:


gopal
Top achievements
Rank 1
 answered on 26 Jul 2011
2 answers
98 views
Is it possible for a programmatic update to the RadGridView.FilterDescriptors collection to be reflected in the column's FilteringControl?

E.g., this code doesn't get automatically reflected in the associated column's popup filter control.
  
grid.FilterDescriptors.Add(fieldName, FilterOperator.IsEqualTo, fieldValue) { MemberType = column.DataType })
- or -
grid.FilterDescriptors.Add(fieldName, FilterOperator.IsNotEqualTo, fieldValue) { MemberType = column.DataType })

But I'd like this code to update the FilteringControl thus providing the user with an alternative mechanism for filtering.

So is there a straightforward way to make that happen?

Many thanks!
Calvin
Top achievements
Rank 2
 answered on 26 Jul 2011
6 answers
270 views
We just got the WPF package last week, so it should be the latest release.

We've set up a basic GridView, but it doesn't allow us to sort the columns.

The XAML looks like this:
<telerik:RadGridView HorizontalAlignment="Stretch" Margin="10,10,10,0" x:Name="ProjectGrid" VerticalAlignment="Stretch" AutoGenerateColumns="False" AlternateRowBackground="#FFEEEEEE" RowIndicatorVisibility="Collapsed" CanUserSortColumns="True" IsReadOnly="True" CanUserFreezeColumns="False" SelectionUnit="FullRow" CanUserResizeColumns="False" IsFilteringAllowed="True" ItemsSource="{Binding  Path=CurrentUser.Quotes, Source={StaticResource applicationViewModel}}">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Header="Project Date" Width=".15*" DataMemberBinding="{Binding Path=ProjectDate}"  DataFormatString="{}{0:MM/dd/yyyy}" />
                <telerik:GridViewDataColumn Header="Customer" Width=".2*" DataMemberBinding="{Binding Path=CustomerName}" />
                <telerik:GridViewDataColumn Header="PO #" Width=".1*" DataMemberBinding="{Binding Path=POnumber}" />
                <telerik:GridViewDataColumn Header="Quote #" Width=".1*" DataMemberBinding="{Binding Path=QuoteNumber}" />
                <telerik:GridViewDataColumn Header="Quote Type" Width=".15*" DataMemberBinding="{Binding Path=QuoteType.Description}" />
                <telerik:GridViewDataColumn Header="User" Width=".2*">
                    <telerik:GridViewDataColumn.CellTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding Path=User.FirstName}" Width="Auto"></TextBlock>
                                <TextBlock Text="{Binding Path=User.LastName}" Margin="5,0,0,0" Width="Auto"></TextBlock>
                            </StackPanel>
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellTemplate>
                </telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="Items" Width=".1*" DataMemberBinding="{Binding QuoteProducts.Count}" />
            </telerik:RadGridView.Columns>
            <mcmds:CommandBehaviorCollection.Behaviors>
                <mcmds:BehaviorBinding Event="MouseDoubleClick" Command="{Binding DoubleClick}" CommandParameter="{Binding SelectedItem, ElementName=ProjectGrid}" />
            </mcmds:CommandBehaviorCollection.Behaviors>
        </telerik:RadGridView>

I've tried setting a SortMemberPath on the columns, but that doesn't buy me any ground. I looked over the GridView documentation on sorting, but I didn't notice anything out of place. 

My colleague set up the attached behavior at the bottom. I may have misheard him, but I believe he said he pulled it from these forums, posted from your team. Basically, we needed to know when the user double-clicked a row, and that does it for us. I tried removing it as well (just in case it was causing the problem), but it didn't change anything.

Thanks!
Bogdan Dumitrescu
Top achievements
Rank 1
 answered on 26 Jul 2011
2 answers
155 views
I downloaded the Q2 release and a quick test in WPF 3.5 works. I tried hosting the map in Winforms 3.5 and it fails:

System.NullReferenceException was unhandled
  Message="Object reference not set to an instance of an object."
  Source="Telerik.Windows.Controls.DataVisualization"
  StackTrace:
       at Telerik.Windows.Controls.Map.MapBaseControl.FindResource[TResourceType](String resourceKey) in c:\TB\101\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Map\Controls\MapBaseControl.cs:line 115
       at Telerik.Windows.Controls.Map.MapBaseControl.RetrieveResource[TResourceType](Object resourceKey) in c:\TB\101\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Map\Controls\MapBaseControl.cs:line 58
       at Telerik.Windows.Controls.Map.MapZoomBar.AddDefaultZoomCommands() in c:\TB\101\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Map\Controls\MapZoomBar.cs:line 295
       at Telerik.Windows.Controls.Map.MapZoomBar.OnMapInitialize(RadMap oldMapControl, RadMap newMapControl) in c:\TB\101\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Map\Controls\MapZoomBar.cs:line 276
       at Telerik.Windows.Controls.Map.MapBaseControl.MapControlChanged(DependencyObject source, DependencyPropertyChangedEventArgs eventArgs) in c:\TB\101\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Map\Controls\MapBaseControl.cs:line 79
       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.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, OperationType operationType, Boolean isInternal)
       at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
       at Telerik.Windows.Controls.Map.MapBaseControl.set_MapControl(RadMap value) in c:\TB\101\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Map\Controls\MapBaseControl.cs:line 35
       at Telerik.Windows.Controls.RadMap.Initialize() in c:\TB\101\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Map\RadMap.cs:line 1475
       at Telerik.Windows.Controls.RadMap.OnApplyTemplate() in c:\TB\101\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Map\RadMap.cs:line 1285
       at System.Windows.FrameworkElement.ApplyTemplate()
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.DockPanel.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.ContextLayoutManager.UpdateLayout()
       at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
       at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
       at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
       at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
       at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.DispatcherOperation.InvokeImpl()
       at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
       at System.Threading.ExecutionContext.runTryCode(Object userData)
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Windows.Threading.DispatcherOperation.Invoke()
       at System.Windows.Threading.Dispatcher.ProcessQueue()
       at System.Windows.Threading.Dispatcher.WndProcHook(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, Boolean isSingleParameter)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
       at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(ApplicationContext context)
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
       at WindowsApplication1.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException:
Andrey
Telerik team
 answered on 26 Jul 2011
2 answers
168 views
I have a gridView that is part of a DataTemplate for a TabControl. One of my columns has a cell edit template that contains a textbox with a context menu. I need to bind the context menu to a collection on my viewmodel. but because it's not part of the virtual tree, I couldn't define the source in xaml. I managed to get it working by handling the Opened event and setting the DataContext of the contextmenu to the same as the user control. It all worked well, but then I ran into some trouble.

Elsewhere in code, I need to be able to call GridView.CommitEdit(), so I moved the DataTemplate code for the TabControl to a new user control to be able to call this method. Doing this however broke my code that sets the DataContext of the Context menu, because the DC of the new user control is not the view model...it is the entityObject to which its bound since it's a DataTemplate.

Is there anyway I can call the CommitEdit method from code-behind if the grid view is defined in a DataTemplate? Or possibly define the context menu elsewhere so that the datacontext can be set on it?
Rossen Hristov
Telerik team
 answered on 26 Jul 2011
5 answers
200 views

Hi,

I have a RadGridView inside RadPane and RadGridView has a context menu. If RadPane is in autohide state and I right click on RadGridView to open context menu, context menu is opened but RadPane gets collapsed and hence context menu also gets closed.

I will be very thankful if anyone can provide solution for this problem.

Konstantina
Telerik team
 answered on 26 Jul 2011
5 answers
264 views
I have a variety of checkboxes in a grid where some of them will be bound to underlying objects (boolean) and others that aren't.  Those that aren't bound will not retain checkbox check marks, but they still allow them to be checked.  When clicking off such a cell, the checkbox will go back to being "unchecked".  I want to have control over these unbound checkboxes to make sure they're visibly "unavailable", whether that means preventing any checking activity at all or changing the appearance of the checkbox to a box with a red x or something of the sort just to let users know that the checkbox cannot and should not be used.

I tried hooking into various events such as CellLoaded, etc. but I couldn't find an event that would allow me to check whether or not the checkbox is checked to explicitly make a modification to an individual cell.  For example,  I tried the following which doesn't work:

void radGridView_CellLoaded(object sender, CellEventArgs e)

{

 

if (e.Cell.Content is DataFormCheckBoxField)

{

((

 

DataFormCheckBoxField)e.Cell.Content).IsEnabled = false;

((

 

DataFormCheckBoxField)e.Cell.Content).IsHitTestVisible = false;

((

 

DataFormCheckBoxField)e.Cell.Content).IsReadOnly = true;

}

}

Milan
Telerik team
 answered on 26 Jul 2011
3 answers
96 views
Hi Team,

We are using telerik rad gridview (Version 2011.1.0419)  in application. It is working very fine. The problem that we are facing is, the columns of gridview are getting collapsed(to very narrow) for few seconds while loading data into it, later the columns widths are adjusting automatically.

Requirement is When the scrollable grid is first displayed, the columns should be displayed in their final form without the collapsing and expanding of columns.

Please let us know what is the resolution for this. I am placing xaml code that we have used.

Also, Please let us know how to display the grid only after loading as a quick solution
<telerik:RadGridView Name="searchResultsGridView" ColumnWidth="*" CanUserDeleteRows="False" IsReadOnly="True" IsFilteringAllowed="False" CanUserSortColumns="True" CanUserInsertRows="False" VerticalAlignment="Top" RowLoaded="OnSearchResultsGridLoaded" SelectionChanged="OnSearchResultsSelectionChanged" RowUnloaded="OnSearchResultsGridUnLoaded"   Height="Auto" Width="Auto" Margin="5,3,5,0" Style="{StaticResource GridViewStyle}" HeaderRowStyle="{StaticResource HeaderStyle}" ItemsSource="{Binding}">
                                <telerik:RadGridView.Columns >
                                    <telerik:GridViewDataColumn Name="createDateCol" Width="Auto"  Header="Last Updated" DataMemberBinding="{Binding CreatedDate}" HeaderCellStyle="{StaticResource ColumnHeaderStyle}" CellStyle="{StaticResource gridcellStyle}"/>
                                    <telerik:GridViewDynamicHyperlinkColumn Name="lastNameCol" Width="Auto"  Header="Last Name" DataMemberBinding="{Binding LastName}"  HeaderCellStyle="{StaticResource ColumnHeaderStyle}" CellStyle="{StaticResource gridcellStyle}"/>
                                    <telerik:GridViewDynamicHyperlinkColumn Name="firstNameCol" Width="Auto" Header="First Name" DataMemberBinding="{Binding FirstName}" HeaderCellStyle="{StaticResource ColumnHeaderStyle}" CellStyle="{StaticResource gridcellStyle}"/>
                                    <telerik:GridViewDataColumn Name="dateOfBrthCol" Header="Age"  DataMemberBinding="{Binding DOB}" Width="Auto" HeaderTextAlignment="Center" TextAlignment="Center" HeaderCellStyle="{StaticResource ColumnHeaderStyle}" CellStyle="{StaticResource gridcellStyle}"/>
                                    <telerik:GridViewDataColumn Name="genderCol"    Header="G" DataMemberBinding="{Binding Gender}" Width="Auto" HeaderCellStyle="{StaticResource ColumnHeaderStyle}" CellStyle="{StaticResource gridcellStyle}"/>
                                    <telerik:GridViewDataColumn Name="stateCol"     Header="ST" DataMemberBinding="{Binding StateCode}" Width="Auto" HeaderCellStyle="{StaticResource ColumnHeaderStyle}" CellStyle="{StaticResource gridcellStyle}"/>
                                    <telerik:GridViewDataColumn Name="quoteIdCol"    Header="Quote/Illustration" Width="Auto" HeaderTextAlignment="Left" TextAlignment="Left" DataMemberBinding="{Binding QuoteId}"  HeaderCellStyle="{StaticResource ColumnHeaderStyle}" CellStyle="{StaticResource gridcellStyle}"/>
                                    <telerik:GridViewDynamicHyperlinkColumn Name="prodDescCol"  UniqueName="prodDescCol"   Header="Product Summary" DataMemberBinding="{Binding ProductDesc}" HeaderCellStyle="{StaticResource ColumnHeaderStyle}" CellStyle="{StaticResource gridcellStyle}"/>
                                    <telerik:GridViewDataColumn Name="annPremCol"   Header="Annual Premium" DataMemberBinding="{Binding AnnualPremium}" HeaderTextAlignment="Right" TextAlignment="Right" Width="Auto" HeaderCellStyle="{StaticResource ColumnHeaderStyle}" CellStyle="{StaticResource gridcellStyle}"/>
                                    <telerik:GridViewDataColumn Name="agntCdCol"    Header="Agent Code" DataMemberBinding="{Binding AgentCode}" HeaderTextAlignment="Right" TextAlignment="Right" Width="Auto" HeaderCellStyle="{StaticResource ColumnHeaderStyle}" CellStyle="{StaticResource gridcellStyle}"/>
                                    <telerik:GridViewDataColumn Name="agntNameCol" Width="Auto" Header="Agent Name" DataMemberBinding="{Binding AgentName}" HeaderCellStyle="{StaticResource ColumnHeaderStyle}" CellStyle="{StaticResource gridcellStyle}"/>
                                    <telerik:GridViewDataColumn Name="gaCodeCol"    Header="GA Code" DataMemberBinding="{Binding GACode}" Width="Auto" HeaderTextAlignment="Right" TextAlignment="Right" HeaderCellStyle="{StaticResource ColumnHeaderStyle}" CellStyle="{StaticResource gridcellStyle}"/>
                                </telerik:RadGridView.Columns>
                            </telerik:RadGridView>


Regards
Ram
Maya
Telerik team
 answered on 26 Jul 2011
1 answer
267 views
Hi there,

it seems like there is no way to clear or remove the pencil/pen icon after editing a row in radgridview control. Does anyone know how to clear/remove the pencil/pen icon after editing a row?

thanks
Maya
Telerik team
 answered on 26 Jul 2011
1 answer
178 views
My company is using RadControls for WPF Q1 2010 SP2. I am extending the RadDatePicker control to add certain behaviors that are used by our FSP suite of programs. We are using Visual Studio 2008 and C#.

When an invalid date is typed into the input box of a RadDatePicker (for example, 13/35/2011), its native behavior is to clear the field. I need to override this behavior to keep (not clear) the invalid input and set an error message property in our extended control. Is this possible and if so, how do I do that? I am not very experienced at how to code event handlers so if you could provide the code for how to hook the event and the skeleton of the new event handler, I would appreciate it.

Would this technique work for the RadTimePicker as well? I need to do the same thing to it.

Thanks,
Mike
Konstantina
Telerik team
 answered on 25 Jul 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
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
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?