Telerik Forums
UI for WPF Forum
1 answer
309 views
 For medium to larger size files (10k words to 100k words) I'm having trouble with performance. CPU usage is actually quite low, but the control is under performing the larger the files become.  For example:

 

I have a 10k word file. Search is lightning faster (fantastic), but replacing is horribly slow, ~10 inserts per second (this gets worse as the file grows). I've wrapped the replace process in a Begin and EndUndoGroup, but that seems a nominal improvement. (see pseudo-snippet below) 

I also have a 100k word file that is essentially unusable in the control. It is plain text, no images or extraneous formatting. It takes 1-5 seconds for keystrokes to register. I've throttled documentchanged event to 10 seconds. After importing the same document into the Telerik demo project (TelerikEditorDemo_WPF) I'm noticing the same performance issue. Again, cpu usage is quite low.

Is there any optimizations that can be done to help with these issues?

 

With UI virtualization is it normal to see 1G+ memory usage by opening up a ~100k word document (700KB file)?

My grid containing the control (row 1)...

<Grid.RowDefinitions>
            <RowDefinition
                Height="117" />
            <RowDefinition
                Height="*" />
            <RowDefinition               
                Height="20" />
        </Grid.RowDefinitions>

 

// Replace functionality below

Editor.BeginUndoGroup();

foreach (TextRange range in Results)

{

    RadDocument.Selection.Clear();                
    RadDocument.CaretPosition.MoveToPosition(range.StartPosition);
    RadDocument.Selection.AddSelectionStart(range.StartPosition);
    RadDocument.Selection.AddSelectionEnd(range.EndPosition);

    Editor.Insert(replaceText);

}

Editor.EndUndoGroup("Replace"); 

Petya
Telerik team
 answered on 29 Jun 2016
3 answers
421 views
Hi,

I want to use the VirtualizingWrapPanel for a thumbnail view (similar to the File explorer view) that I'm building. However the thumbnails that the panel holds will not all be of the same size. Now the problem I'm facing is that the VirtualizingWrapPanel requires me to specify the ItemWidth. I cannot provide the ItemWidth because the width of the thumbnails are not always the same.. Is there any way to provide something similar to "auto" for ItemWidth? Any suggestions?

Currently I'm using the WPF VirtualizingStackPanel and it seems to work great but I'm wasting a lot of UI space and therefore want to use VirtualizingWrapPanel instead.

Thank you,
Rajani.
Yoan
Telerik team
 answered on 29 Jun 2016
1 answer
152 views
Importing large-ish docx files that have been exported using the DocxFormatProvider hangs on provider.Import(stream);  The same document imported directly from word works fine. Exporting the document as html then importing works fine. Only when exporting as docx, then importing again does it hang.
 
Seems to either be an issue with a high number of spans or images as I can export and import documents of far greater size as long as it is plain text without a lot of embedded links.

 

Easy to replicate:

1) Create a new document, copy the contents of the wiki page https://en.wikipedia.org/wiki/Parthian_Empire (high number of formatting changes and images)

2) Paste into document and export to docx

3) Try to import

 

The exact same document created directly in word and imported to RadRTB imports fine (2-3 seconds)

Mihail
Telerik team
 answered on 29 Jun 2016
3 answers
111 views

It looks like the AutoBindBehavior doesn't handle the case where custom PropertyDefinitions are used, a PropertySetMode of Union or Intersection is used and an IEnumerable is assigned to the PropertyGrid.Item. This results in a Linq exception: Sequence contains no elements with the following callstack:

   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
   at Telerik.Windows.Controls.Data.PropertyGrid.AutoBindBehavior.BindEditor(FrameworkElement editorElement, DependencyProperty property)
   at Telerik.Windows.Controls.Data.PropertyGrid.AutoBindBehavior.<>c__DisplayClass4.<OnUpdateBindingOnElementLoaded>b__0(Object s, RoutedEventArgs args)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
   at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
   at MS.Internal.LoadedOrUnloadedOperation.DoWork()
   at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()

Stefan
Telerik team
 answered on 29 Jun 2016
1 answer
344 views
Hello,

Due to project requirements for a big customer I need to bind entity framework 6 dbcontext directly to telerik controls, in this case to a radgridview control, so i need to use IQueryable instead of ObservableCollection also to perform filtering, sorting and so on.  

The point is that when I add, delete a customer from dbcontext, the radgridview don't refresh showing changes.  Also when I perform this operations directly in database, after refreshing dbcontext the radgridview not showing changes.

I tried to implement INotifyPropertyChanged and INotifyCollectionChanged in my view model but without success.  

Also I want to point out that due to mvvm pattern design I can't have code in mainwindow.xaml.cs.

Please, anyone can provide me a full example of how to achieve this? 

Thanks in advance.
Dilyan Traykov
Telerik team
 answered on 29 Jun 2016
10 answers
481 views
Hi, 
I have PDF files that contains of several pages but with only 2 MB more or less.
When the RadPdfViewer loads the document a OutOfMemoryException occured. 
CallStack: 

Insufficient memory to continue the execution of the program.

   at System.Windows.Media.Imaging.WriteableBitmap..ctor(Int32 pixelWidth, Int32 pixelHeight, Double dpiX, Double dpiY, PixelFormat pixelFormat, BitmapPalette palette)
   at Telerik.Windows.Media.Imaging.RadBitmap..ctor(Int32 width, Int32 height, Int32[] pixels)
   at Telerik.Windows.Documents.Fixed.UI.UIElementsHelper.CreateImageSource(ResourceKey key, ImageSource source)
   at Telerik.Windows.Documents.Fixed.UI.UIElementsHelper.ImageLoader_WorkCompleted(Object sender, WorkCompletedEventArgs e)
   at Telerik.Windows.Documents.Core.Utils.ResourceLoader.OnWorkCompleted(WorkCompletedEventArgs args)
   at Telerik.Windows.Documents.Core.Utils.ResourceLoader.Worker_RunWorkerCompleted(Object sender, RunWorkerCompletedEventArgs e)
   at System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted(RunWorkerCompletedEventArgs e)
   at System.ComponentModel.BackgroundWorker.AsyncOperationCompleted(Object arg)
   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.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   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.LegacyInvokeImpl(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()
Tanya
Telerik team
 answered on 29 Jun 2016
3 answers
322 views

Hi everyone,

I want to make a control radDataGridView with toolbar not user control

In toolbar, buttons located like add/edit/delete/show group panel...etc.

how do i make it ?

thanks for your interest.

YoungKee
Top achievements
Rank 1
 answered on 29 Jun 2016
3 answers
115 views

hello,

I'm having a problem with my code

I wrote this code  in a userControl tag:

<UserControl

.

.

xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">

<Grid>

     <GridDefinitions>

         <RowDefinition Height="25" />

          <RowDefinition Height='*' />

       </GridDefinitions>

 

      <stackPannel Grid.Row="0">

         <lable/>

         <Button Content="Refresh" Command="{Binding RefreshCommand}"/>

       </StackPannel>

 

       <ScrollViewer Grid.Row="1">

          <StackPannel>

            <telerik:RadExpender IsExpender="True">

                  <telerik:RadGridView SelectionMode="Single" IsSyncrinizeWithCurrentItem="True" AutoGenerateColumns="True"  ItemsSource="{Binding SomeList1}"/>

            </telerik:RadExpender>

 

            <telerik:RadExpender IsExpender="True">
                  <telerik:RadGridView SelectionMode="Single" IsSyncrinizeWithCurrentItem="True" AutoGenerateColumns="True"  ItemsSource="{Binding SomeList2}"/>
            </telerik:RadExpender> 

 

            <telerik:RadExpender IsExpender="True">
                  <telerik:RadGridView SelectionMode="Single" IsSyncrinizeWithCurrentItem="True" AutoGenerateColumns="True"  ItemsSource="{Binding SomeList3}"/>
            </telerik:RadExpender> 

 

       </StackPannel>

      </ScrollViewer>

     </Grid>

  </UserControl>

 

the result is that my scroll view fill only about half of the screen instead of the whole screen, there is no problem with its width only its height is wrong.

funny thing that happen: at run time if I click on the first exdpender's button in order to set IsExpended to false

the scroll view suddenly get the right height and fill the whole area.

what is wrong with this code?

I tried change stackPannel to DouckPannel,Grid, set the height... 

how can I make the scrollview know it's height if I do not know the length of the ItemSource on each radexpender

thank you

 

Kiril Vandov
Telerik team
 answered on 29 Jun 2016
1 answer
97 views
Hi,

At the moment the appointment window is a dialog box, is it possible to have it be a window so it's not locking down the UI? Something like when editing a recurring appointment, it's not a dialog window. 
Kalin
Telerik team
 answered on 29 Jun 2016
1 answer
178 views
Hi,

I try to have a button disabled when there is no text in my RadRichTextBox by using MVVM. The output I need is HTML and I used to have a HtmlFormatProvider and a TxtDataProvider. I noticed with this that my typing was really slow. The datasource was not updated when I pressed enter (or send, for a chat-like application), this resulted in missing letters in mails or chats.

I wanted to try it without the TxtDataProvider, because I do not need the plain text (only for checking empty). Only thing is the disabled button, I can't check if the HTML is empty, because there always is HTML. I found a way to check if the value of the Document is empty. On DocumentChanged I can check: RadRichTextBox.Document.IsEmpty. But this can't be binded in my ViewModel because Document is not a dependencyproperty. 

It would be nice to just bind IsEnabled to a property for the RadRichTextBox, is there a way to do this? Binding to a viewmodel will also resolve the issue. Or is there a way to speed up my RadRichTextBox and the providers?

Thanks,
Rob
Todor
Telerik team
 answered on 29 Jun 2016
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
Slider
Expander
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
WebCam
CardView
DataBar
Licensing
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
HighlightTextBlock
Security
TouchManager
StepProgressBar
VirtualKeyboard
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?