or
pagesGridView.GroupDescriptors.Add( |
new GroupDescriptor { |
Member = "CmsPageParent.Title", |
SortDirection = ListSortDirection.Ascending |
} |
); |
How do I set the "title" property of the group? I need to simulate the grouping of a column named “Parent” – as far as I can see I cannot mark a column as a default grouping set so I need to do it programmatically. However when I do it this way the resulting item in the group header says “CmsPageParent.Title” not “Parent” as the header for the same column would.
Ideas?
<telerik:RadGridView Grid.Row="1" Name="pagesGridView" telerik:StyleManager.Theme="Vista" DataLoadMode="Synchronous" AutoGenerateColumns="False" CanUserInsertRows="False" CanUserFreezeColumns="False" UseAlternateRowStyle="True" ColumnsWidthMode="Auto" ShowGroupPanel="True" SourceUpdated="pagesGridView_SourceUpdated"> |
<telerik:RadGridView.Columns> |
<telerik:GridViewDataColumn x:Name="ParentColumn" HeaderText="Parent" Width="200" DataMemberBinding="{Binding Path=CmsPageParent.Title}" /> |
<telerik:GridViewDataColumn x:Name="StatusColumn" HeaderText="Status" Width="200" DataMemberBinding="{Binding Path=CmsItemState.Name}" /> |
<telerik:GridViewDataColumn x:Name="Title" HeaderText="Name" Width="*" DataMemberBinding="{Binding Path=Title}" /> |
</telerik:RadGridView.Columns> |
</telerik:RadGridView> |
Any help?
FrameworkElementFactory radComboFactory = new FrameworkElementFactory ( typeof ( RadComboBox ), "RadComboFactory" ); |
radComboFactory.SetValue ( RadComboBox.ItemsSourceProperty, property.AvailableValues ); |
radComboFactory.SetValue ( RadComboBox.SelectedValuePathProperty, "Key" ); |
radComboFactory.SetValue ( RadComboBox.SelectedValueProperty, currentValue ); |
radComboFactory.SetValue ( RadComboBox.IsDropDownOpenProperty, true ); |
radComboFactory.SetValue ( CSRadComboSelectionChanged.CommandProperty, CellEditTemplateComboSelectionChange ); |
propertyDataTemplate.VisualTree = radComboFactory; |
propertyDataTemplate.Seal ( ); |
System.NullReferenceException was unhandled Message="Object reference not set to an instance of an object." Source="Telerik.Windows.Controls.Input" StackTrace: at Telerik.Windows.Controls.RadComboBox.OnIsDropDownOpenChanged(Boolean oldValue, Boolean newValue) |
at Telerik.Windows.Controls.RadComboBox.OnIsDropDownOpenChanged(DependencyObject sender, 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, 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 System.Windows.FrameworkTemplate.SetTemplateParentValues(String name, Object element, FrameworkTemplate frameworkTemplate, ProvideValueServiceProvider& provideValueServiceProvider) |
at System.Windows.FrameworkElementFactory.InstantiateUnoptimizedTree() |
at System.Windows.FrameworkTemplate.LoadContent() |
at Telerik.Windows.Controls.GridViewColumn.CreateCellEditElement(GridViewCell cell, Object dataItem) |
at Telerik.Windows.Controls.GridView.GridViewCell.SetEditorContent(Object content) |
at Telerik.Windows.Controls.GridView.GridViewCell.ShowEditor() |
at Telerik.Windows.Controls.GridView.GridViewCell.<ToggleEditor>b__0() |
at Telerik.Windows.Controls.GridView.GridViewCell.ModifyCellTemplate(Action executeAction) |
at Telerik.Windows.Controls.GridView.GridViewCell.ToggleEditor() |
at Telerik.Windows.Controls.GridView.EditContext.OnCellEditModeChanged(GridViewCell cell, Boolean newIsInEditMode) |
at Telerik.Windows.Controls.GridView.GridViewCell.IsInEditModeChanged(DependencyObject target, 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, 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.GridView.GridViewCell.set_IsInEditMode(Boolean value) |
at Telerik.Windows.Controls.GridView.EditContext.SwitchCellToEditMode(GridViewCell cell) |
at Telerik.Windows.Controls.GridView.EditContext.BeginEdit(GridViewCell gridViewCell) |
at Telerik.Windows.Controls.GridView.EditContext.OnCellMouseUp(GridViewCell cell) |
at Telerik.Windows.Controls.GridView.GridViewCell.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.CrackMouseButtonEventAndReRaiseEvent(DependencyObject sender, MouseButtonEventArgs e) |
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.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, Int32 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, 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 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 ***********.Shell.App.Main() in *****************************************************************\obj\Debug\App.g.cs:line 0 |
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() |