Hello,
I don't suppose there is a way to handle a click on the header of a column, or even better a way to just sort the columns when you click on a column header?
Also, is there a way to register a click on the depence arrows so I can show more detailed info. when they are clicked?
Thanks,
Eric
I don't suppose there is a way to handle a click on the header of a column, or even better a way to just sort the columns when you click on a column header?
Also, is there a way to register a click on the depence arrows so I can show more detailed info. when they are clicked?
Thanks,
Eric
3 Answers, 1 is accepted
0
Hi Eric,
There are no built-in features for both behaviors, but you could create implicit styles for these headers and dependency arrows and create an attached behavior which adds this functionality to them. For more information about attached behaviors you might refer to this article.
Please refer to the attached project that demonstrates the idea.
Kind regards,
Miroslav Nedyalkov
the Telerik team
There are no built-in features for both behaviors, but you could create implicit styles for these headers and dependency arrows and create an attached behavior which adds this functionality to them. For more information about attached behaviors you might refer to this article.
Please refer to the attached project that demonstrates the idea.
Kind regards,
Miroslav Nedyalkov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Nelson
Top achievements
Rank 1
answered on 12 Jul 2012, 01:30 PM
This project doesn't seem to run, at least with the Q2 2012 release? Fails in debug with:
System.NullReferenceException was unhandled
Message=Object reference not set to an instance of an object.
Source=Telerik.Windows.Controls.GanttView
StackTrace:
at Telerik.Windows.Controls.GanttView.ColumnDefinition.CreateGetValueFuncForType(Type type) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\GanttView\GanttView\Gantt\ColumnDefinitions\ColumnDefinition.cs:line 51
at Telerik.Windows.Controls.GanttView.ColumnDefinition.GetItemValue(Object dataItem) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\GanttView\GanttView\Gantt\ColumnDefinitions\ColumnDefinition.cs:line 41
at Telerik.Windows.Controls.GanttView.CellInfo.GetValue() in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\GanttView\GanttView\Gantt\RenderingViewModels\CellInfo.cs:line 46
at Telerik.Windows.Controls.GanttView.CellInfo.GetFormattedValue() in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\GanttView\GanttView\Gantt\RenderingViewModels\CellInfo.cs:line 52
at Telerik.Windows.Controls.GanttView.SimpleCellContainer.UpdateTextBlock() in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\GanttView\GanttView\Gantt\Containers\SimpleCellContainer.cs:line 53
at Telerik.Windows.Controls.GanttView.SimpleCellContainer.OnApplyTemplate() in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\GanttView\GanttView\Gantt\Containers\SimpleCellContainer.cs:line 44
at System.Windows.FrameworkElement.ApplyTemplate()
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at Telerik.Windows.Rendering.LogicalCanvasPanel.MeasureContainers(IContainerRecycler recycler, Size availableSize) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Scheduling.Core\Scheduling\Rendering\LogicalCanvas\LogicalCanvasPanel.cs:line 142
at Telerik.Windows.Rendering.Virtualization.VirtualizedPanel.MeasureOverride(Size availableSize) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Scheduling.Core\Scheduling\Rendering\Virtualization\VirtualizedPanel.cs:line 73
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.ContextLayoutManager.UpdateLayout()
at System.Windows.Interop.HwndSource.SetLayoutSize()
at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
at System.Windows.Window.SetRootVisualAndUpdateSTC()
at System.Windows.Window.SetupInitialState(Double requestedTop, Double requestedLeft, Double requestedWidth, Double requestedHeight)
at System.Windows.Window.CreateSourceWindow(Boolean duringShow)
at System.Windows.Window.ShowHelper(Object booleanBox)
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.WrappedInvoke(Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
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.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, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, 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.Application.RunInternal(Window window)
at System.Windows.Application.Run()
at GanttElementsInteraction.App.Main() in D:\WPF_Apps\telerik\GanttElementsInteraction\obj\Debug\App.g.cs:line 0
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
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:
could you post an example that runs with the current release?
System.NullReferenceException was unhandled
Message=Object reference not set to an instance of an object.
Source=Telerik.Windows.Controls.GanttView
StackTrace:
at Telerik.Windows.Controls.GanttView.ColumnDefinition.CreateGetValueFuncForType(Type type) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\GanttView\GanttView\Gantt\ColumnDefinitions\ColumnDefinition.cs:line 51
at Telerik.Windows.Controls.GanttView.ColumnDefinition.GetItemValue(Object dataItem) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\GanttView\GanttView\Gantt\ColumnDefinitions\ColumnDefinition.cs:line 41
at Telerik.Windows.Controls.GanttView.CellInfo.GetValue() in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\GanttView\GanttView\Gantt\RenderingViewModels\CellInfo.cs:line 46
at Telerik.Windows.Controls.GanttView.CellInfo.GetFormattedValue() in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\GanttView\GanttView\Gantt\RenderingViewModels\CellInfo.cs:line 52
at Telerik.Windows.Controls.GanttView.SimpleCellContainer.UpdateTextBlock() in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\GanttView\GanttView\Gantt\Containers\SimpleCellContainer.cs:line 53
at Telerik.Windows.Controls.GanttView.SimpleCellContainer.OnApplyTemplate() in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\GanttView\GanttView\Gantt\Containers\SimpleCellContainer.cs:line 44
at System.Windows.FrameworkElement.ApplyTemplate()
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at Telerik.Windows.Rendering.LogicalCanvasPanel.MeasureContainers(IContainerRecycler recycler, Size availableSize) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Scheduling.Core\Scheduling\Rendering\LogicalCanvas\LogicalCanvasPanel.cs:line 142
at Telerik.Windows.Rendering.Virtualization.VirtualizedPanel.MeasureOverride(Size availableSize) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Scheduling.Core\Scheduling\Rendering\Virtualization\VirtualizedPanel.cs:line 73
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.ContextLayoutManager.UpdateLayout()
at System.Windows.Interop.HwndSource.SetLayoutSize()
at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
at System.Windows.Window.SetRootVisualAndUpdateSTC()
at System.Windows.Window.SetupInitialState(Double requestedTop, Double requestedLeft, Double requestedWidth, Double requestedHeight)
at System.Windows.Window.CreateSourceWindow(Boolean duringShow)
at System.Windows.Window.ShowHelper(Object booleanBox)
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.WrappedInvoke(Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
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.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, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, 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.Application.RunInternal(Window window)
at System.Windows.Application.Run()
at GanttElementsInteraction.App.Main() in D:\WPF_Apps\telerik\GanttElementsInteraction\obj\Debug\App.g.cs:line 0
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
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:
0
Hi Nelson,
This is because there is not MemberBinding set - this works correctly with the latest internal build version, but throws an exception with the official version. To see the demo just set a MemberBinding to the ColumnDefintions.
Hope this helps.
Greetings,
Miroslav Nedyalkov
the Telerik team
This is because there is not MemberBinding set - this works correctly with the latest internal build version, but throws an exception with the official version. To see the demo just set a MemberBinding to the ColumnDefintions.
<
telerik:RadGanttView.Columns
>
<
telerik:ColumnDefinition
ColumnWidth
=
"200"
Header
=
"Column 1"
MemberBinding
=
"{Binding Start}"
/>
<
telerik:ColumnDefinition
ColumnWidth
=
"200"
Header
=
"Column 2"
MemberBinding
=
"{Binding End}"
/>
</
telerik:RadGanttView.Columns
>
Hope this helps.
Greetings,
Miroslav Nedyalkov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>