Hello, I have been using Telerik in a WPF desktop application. We have a control that displays a large amount of data points (ranging from around a thousand points to over a million points), and a custom selector that lets you designate a section of the data to zoom in on.
We want to replace the custom selector we are currently using with the selector from the TimeBar control. We use points instead of dates, but I got around the issue by representing each point as a 'day'. The problem is, when I add a large amount of data to the RadLinearSparkline (26,000 points of random numbers), the selector control becomes sluggish, for example the resize selector has a 3-4 second delay if I move one of the bounds.
So I technically have 3 questions:
Does the TimeBar support large amounts of data?
Is there a way to change the range data from date-times to doubles/ints (or another control with the same selector)?
Is there a way I can just use the selector without the time bar itself?
Here is the relevant code in my example project
----------------------------------------------------------------------------------------------------------------------------------------------------------
Random r = new Random();
List<int> LinearData = new List<int>();
for (DateTime currentDate = DateTime.Today; currentDate < DateTime.Today.AddDays(1000000);
currentDate = currentDate.AddDays(1))
{
LinearData.Add(r.Next(0, 100000));
}
this.DataContext = LinearData;
-----------------------------------------------------------------------------------------------------------------------------------------------------------
<telerik:RadTimeBar PeriodStart="1-Jan-0001 12:00:00 AM" PeriodEnd="31-Dec-2740 11:59:59 PM"
VisiblePeriodStart="11-Nov-2010 12:00:00 AM" VisiblePeriodEnd="14-March-2011 11:59:59 PM"
SelectionStart="1-Jan-2011 12:00:00 AM" SelectionEnd="28-Feb-2011 11:59:59 PM">
<telerik:RadTimeBar.Intervals>
</telerik:RadTimeBar.Intervals>
<telerik:RadLinearSparkline ItemsSource="{Binding}"/>
</telerik:RadTimeBar>
If you need any additional information about the project, let me know
Dear experts,
I am having this Exception randomly in my WPF application, any idea how to fix it? I occurs randomly when I try to add a source data file on my application:
12/06/2017 02:37:28 PM Fatal: App :: Unhandled Exception!
Machine Name : .....User Name :.......
Exception : System.NullReferenceException: Object reference not set to an instance of an object.
at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.FlatLayoutStrategy.RealizeRows(Int32 startIndex, Int32 endIndex, Double& verticalOffset, HashSet`1& realizedRows)
at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.FlatLayoutStrategy.MeasureOverride(Size availableSize)
at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.MeasureOverride(Size availableSize)
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.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, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
12/06/2017 02:57:02 PM Fatal: App :: Unhandled Exception!
Machine Name : ......User Name : ......
Exception : System.NullReferenceException: Object reference not set to an instance of an object.
at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.FlatLayoutStrategy.RealizeRows(Int32 startIndex, Int32 endIndex, Double& verticalOffset, HashSet`1& realizedRows)
at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.FlatLayoutStrategy.MeasureOverride(Size availableSize)
at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.MeasureOverride(Size availableSize)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
at System.Windows.Controls.ScrollContentPresenter.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint)
at Telerik.Windows.Controls.GridView.GridViewScrollViewer.MeasureOverride(Size availableSize)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Border.MeasureOverride(Size constraint)
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 MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Border.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Control.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Control.MeasureOverride(Size constraint)
at Telerik.Windows.Controls.GridView.GridViewDataControl.MeasureOverride(Size availableSize)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Border.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Border.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Control.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Control.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Border.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Control.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Control.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Documents.AdornerDecorator.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Control.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Documents.AdornerDecorator.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Window.MeasureOverrideHelper(Size constraint)
at System.Windows.Window.MeasureOverride(Size availableSize)
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.FireInvokeOnRenderCallbacks()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.AnimatedRenderMessageHandler(Object resizedCompositionTarget)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
I have read through the samples and the docs trying to get the flat self-referencing data binding to work with the tree view, but I am not making good progress.
My application is using the MVVM design pattern. When I run my application, I do not get any data in the tree view, but my view model has fetched the data that I expect to see in the tree view.
When I debug the application, the class is called before the Loaded event handler has fired, passing it my uninitialized view model, which it can do nothing with. When that call completes, the Loaded event handler is called and the view model is initialized with the data for the tree view, but the converter is not called again.
I need some help trying to understand how I should be using this control, I am not getting it despite having read through your SDK docs and samples.
Thanks
-Sean
Hi Telerik,
I'm export my RadDiagram to Image with the appropriate functionnality, but I have an error (not systematically).
My code :
Private
Function
CreateStreamFromDiagram(diag
As
RadDiagram, rect
As
Windows.Rect)
As
MemoryStream
If
diag
Is
Nothing
Then
Return
New
MemoryStream({})
Dim
mem_stream
As
New
MemoryStream()
diag.ExportToImage(
stream:=mem_stream,
encoder:=
New
System.Windows.Media.Imaging.JpegBitmapEncoder(),
enclosingBounds:=rect,
returnImageSize:=rect.Size,
backgroundBrush:=Windows.Media.Brushes.White,
margin:=
New
Windows.Thickness(1),
dpi:=DIAGRAM_IMG_DPI
)
Return
mem_stream
End
Function
When the method is called, sometimes, I have this error :
à System.Windows.Media.Imaging.WriteableBitmap.InitFromBitmapSource(BitmapSource source)
à System.Windows.Media.Imaging.WriteableBitmap..ctor(BitmapSource source)
à Telerik.Windows.Controls.Diagrams.BitmapUtils.CreateWriteableBitmap(UIElement element, Rect enclosingBounds, Size returnImageSize, Brush backgroundBrush, Thickness margin, Double dpi)
à Telerik.Windows.Controls.RadDiagram.CreateDiagramImage(Rect enclosingBounds, Size returnImageSize, Brush backgroundBrush, Thickness margin, Double dpi)
à Telerik.Windows.Controls.RadDiagram.ExportToImage(Stream stream, BitmapEncoder encoder, Nullable`1 enclosingBounds, Size returnImageSize, Brush backgroundBrush, Thickness margin, Double dpi)
à Portal_ViewModel.MirBuilder.PdfAReportItext7.CreateStreamFromDiagram(RadDiagram diag, Rect rect) dans C:\Users\ng707d2\Desktop\DEV\MAA_MIR_Builder_v2\Sources\WPFPortal\Portal_ViewModel\Mir_Builder\PDFGeneration\PdfAReportItext7.vb:ligne 1292
à Portal_ViewModel.MirBuilder.PdfAReportItext7.ExportInspectionDiagToImage(Single p_widthRedRectangle) dans C:\Users\ng707d2\Desktop\DEV\MAA_MIR_Builder_v2\Sources\WPFPortal\Portal_ViewModel\Mir_Builder\PDFGeneration\PdfAReportItext7.vb:ligne 1397
à Portal_ViewModel.MirBuilder.PdfAReportItext7.ExportPage() dans C:\Users\ng707d2\Desktop\DEV\MAA_MIR_Builder_v2\Sources\WPFPortal\Portal_ViewModel\Mir_Builder\PDFGeneration\PdfAReportItext7.vb:ligne 1360
à Portal_ViewModel.MirBuilder.PdfAReportItext7.ExportCurrentOnglet() dans C:\Users\ng707d2\Desktop\DEV\MAA_MIR_Builder_v2\Sources\WPFPortal\Portal_ViewModel\Mir_Builder\PDFGeneration\PdfAReportItext7.vb:ligne 446
Sometimes, the error is an OutOfMemoryException type, but sometimes, the error is "Unable to evaluate expression".
And others times, the error is not occurred...
Do you have any idea about this problem ?
Thank you.
Valentin.
Thanks
I'm using RadTreeView's drag drop feature to reorder/nest items.
The control has many features that I (drop preview line, TreeViewDragVisual, and tooltip).
However, I need to execute some complex reorder/nest/unnest logic for the actual drag/drop operation (guards, pre and post).
So far, I was able to implement my guards by binding the RadTreeViewItem.IsDropAllowed.
But have no idea how to run some code before and after a drag/drop.
My questions:
1. Is it possible to invoke a command for a drag/drop operation, instead of automatically manipulating the bound collection?
2. Which events do I listen to before and after (collection is modified) a drag/drop operation? DragStarted and DragEnded events have been marked obsolete.
And if there is a workaround (custom implementation of drag/drop), can I continue using the other features of RadTreeView (drop preview line, TreeViewDragVisual, and tooltip)?
Thanks
minchew
I am creating a RadCartesianChart3D with multiple series of data. I was looking at the documentation for the control, and I didn't see a way to include a legend for the graph.
Is there a way to add a legend to the graph that just has the series name and corresponding color?
Additionally, I want to have a few graphs that use a "Heatmap" legend. I've attached a sample image of the way I want the legend to work, but it is essentially a liner gradient with labeled intervals on the gradient.
If there is an inbuilt way to include a Heatmap as the legend, I would like to know. Otherwise if someone has implemented a similar type of legend, how did you accomplish it?
Hello Telerik,
I want Rad.ComboBox to be edited, i.e. I want to be able to search and select an item inside the combobox and also in case I don't have an item inside the combo, I would like to be able to type the new value and be able to bind the new item to save later.
What happens right now is that when the item I am looking for is not in combobox, as soon as I leave the combo the value inside the combobox is lost!
My question is how can I keep the search and auto-complete ability inside the combobox and also be able to keep the typed value?
Please answer asap.
Best Regards
Kourosh