Telerik Forums
UI for WPF Forum
4 answers
288 views
Good afternoon,

From time to time I've been experiencing Out of Memory Exception with RadRichText box library version 2013.1.222.40.

My exception is usually thrown when I right click to open the document Context Menu.

I would like to point out that I do add custom items to the document Context Menu depending if the user right clicks in a section with Custom Annotations.

e.g.

private void ContextMenuSubscribe()
{
    this.radRichTextBox.ContextMenu = new Telerik.Windows.Controls.RichTextBoxUI.ContextMenu();
    ContextMenu contextMenu = (ContextMenu)this.radRichTextBox.ContextMenu;
    contextMenu.Showing += this.ContextMenu_Showing;
}

private void ContextMenu_Showing(object sender, ContextMenuEventArgs e)
{
    #region Discontinue Product Menu Item
 
    // First check the context - if last selected annotation is product and user permissions
    if (Properties.Settings.Default.SystemUserPermissions.ProductsCanDiscontinue == true && !(this.radRichTextBox.Document.Selection.IsEmpty)
        && RadDocumentExtensions.GetLastSelectedAnnotationMarker(this.radRichTextBox.Document) is SemanticRangeStart)
    {
        //Get the selected annotations
        List<SemanticRangeStart> products = RadDocumentExtensions.GetSelectedAnnotationsRangeStarts<SemanticRangeStart>(this.radRichTextBox.Document);
 
        //Check Product Count is greater than 0
        if (products != null && products.Count > 0)
        {
            //Add menu item to data context
            RadMenuItem discontinueProductMenuItem = new RadMenuItem()
            {
                Header = "Discontinue Product",
                Icon = new System.Windows.Controls.Image() { Source = new BitmapImage(new Uri("Icons/Spec-Editor-Menu/block.png", UriKind.Relative)) },
                Tag = products[products.Count - 1] //Get last product item in selection
            };
            discontinueProductMenuItem.Click += this.DiscontinueProductMenuItem_Click;
            ContextMenuGroup customContextMenuGroup = new ContextMenuGroup();
            customContextMenuGroup.Add(discontinueProductMenuItem);
            e.ContextMenuGroupCollection.Add(customContextMenuGroup);
        }
    }
 
    #endregion
 
    #region Product Pricing Menu Item
 
    // First check the context - if selected annotation is end product and user permissions
    if (Properties.Settings.Default.SystemUserPermissions.OrderCanEdit == true && !(this.radRichTextBox.Document.Selection.IsEmpty) &&
        RadDocumentExtensions.GetLastSelectedAnnotationMarker(this.radRichTextBox.Document) is SemanticRangeStart)
    {
        //Get the selected annotations
        List<SemanticRangeStart> products = RadDocumentExtensions.GetSelectedAnnotationsRangeStarts<SemanticRangeStart>(this.radRichTextBox.Document);
 
        //Checked the last selected item is an end item
        //if (products.Count >= 0 && products[products.Count - 1].Product.HasChild == false)
        //{
            //Add menu item to data context
            RadMenuItem addPriceMenuItem = new RadMenuItem()
            {
                Header = "Set Price",
                Icon = new System.Windows.Controls.Image() { Source = new BitmapImage(new Uri("Icons/Spec-Editor-Menu/sterling_pound_currency_50.png", UriKind.Relative)) },
                Tag = products[products.Count - 1]
            };
            addPriceMenuItem.Click += this.SetPriceMenuItem_Click;
            ContextMenuGroup customContextMenuGroup = new ContextMenuGroup();
            customContextMenuGroup.Add(addPriceMenuItem);
            e.ContextMenuGroupCollection.Add(customContextMenuGroup);
        //}
    }
 
    #endregion
 
    #region Add New Item To Database Menu Item
 
    //Check Conditions
    if (Properties.Settings.Default.SystemUserPermissions.ProductsCanAdd == true &&
        this.radRichTextBox.Document.Selection.IsEmpty && RadDocumentAutoComplete.IsPositionBetweenDefinedAnnotations(this.radRichTextBox.Document.CaretPosition) == false)
    {
        //Check if text exists at caret position
        string text = RadDocumentExtensions.GetSpanBoxText(this.radRichTextBox.Document.CaretPosition);
 
        if (!String.IsNullOrWhiteSpace(text))
        {
            text.Trim();
 
            //Create New Menu Item
            RadMenuItem addNewItemToDatabase = new RadMenuItem()
            {
                Header = "Add New Item",
                Icon = new System.Windows.Controls.Image() { Source = new BitmapImage(new Uri("Icons/Spec-Editor-Menu/Database-Add-48.png", UriKind.Relative)) }
            };
 
            addNewItemToDatabase.Click += this.AddNewItemToDatabaseMenuItem_Click;
            ContextMenuGroup customContextMenuGroup = new ContextMenuGroup();
            customContextMenuGroup.Add(addNewItemToDatabase);
            e.ContextMenuGroupCollection.Add(customContextMenuGroup);
        }
    }
 
    #endregion
}


My application has also been designed to host multiple instance RadRichTextBox in RadDocking Panes (see the attached image). The docking panes are created and closed on a regular basis throughout the lifetime of the applications runtime.

Another point to add is that my RadDocuments contain a lot of Custom Annotations (unfortunately I cannot upload an example to this forum due to the filters for you to see).

To iterate my previous points, the Out of Memory Exception thus far only seems to occur once my application has been running for some time and only seems to occur when opening the Context Menu between custom annotations.

Is the Out of Memory Exception a known issue with library version 2013.1.222.40?
And can you offer any advice on what may be causing it and how to prevent the exception?

Many thanks,

Rob



 
Robert
Top achievements
Rank 1
 answered on 06 Mar 2014
4 answers
166 views
Your Control Panel is a WPF app with a nice auto-updater.

For WPF developers, deployment and automatic updates are always important issues to deal with so I'm wondering if you developed this auto-update technology in house and if so, would you consider releasing this techonology bundled with your UI for WPF so we can all use it and if not, why not?

Thanks,

Dean
Dean
Top achievements
Rank 1
 answered on 06 Mar 2014
2 answers
145 views
Hi,

I have a project which will use the RibbonView (if I can make it work like I want). I have managed to bind simple business objects to the ribbon and display tabs, groups and buttons including icons, but this is where it stops. My problem is that I am unable to find a good way to attach events to the buttons dynamically. The application has a lot of child views and each of these will have it's own items on the ribbonview. I was hoping that I could have one ribbon view defined in the main view and just bind business objects from the childviews. I was also hoping I could mix items on the ribbon view from both the main view and the active child view so that I don't have to add those "global" items everytime.

What I have done now is that I have one event handler in the datatemplate which handles all events from all buttons on the ribbon. This is a problem as I cannot distinguish them in any way except from looking at the content/text of the buttons, but this seems rather "ugly".

Do you have any good suggestion on how I can dynamically add items to ribbonview for a childview with attached events? Can I achieve this just by binding business objects or do I have to create a viewmodel and a view with a whole RadRibbonView for each separate childview? So far I haven't defined anything in xaml except for the ribbon view itself and the templates. Will this work or must I start defining tabs, groups and buttons so that I can add dedicated events to each of them?

I have looked at the RadRibbonView demo (Paint) you have where business objects are bound to the RibbonView with tabs, groups and buttons including icons, but no events are attached so it doesn't help me anything.

I'm sure there is some easy solution to this as it has to be a common scenario to dynamically populate a ribbon from multiple views. Probably I'm just missing something obvious, but hopefully you can help me with this.
 
Regards,
Rolf




Martin Ivanov
Telerik team
 answered on 05 Mar 2014
20 answers
387 views
I've been trying to get spell checking working for Arabic text entered into a RadRichTextBox, however it never appears to check the spelling of any Arabic words entered.  No Arabic words are getting marked as misspelled.

I've tried loading the ar-AR.tdf dictionary that can be downloaded into the editor's DocumentSpellChecker, and I've tried setting the spell checker's locale to AR, but neither have any effect.  I've also tried creating a class that implements ISpellChecker, and I've found that  CheckWordIsCorrect is never getting called for Arabic words, though it does seem to be getting called for any Latin-character words.

The same problem occurs with Hebrew text, though spell checking is working with Russian.

Is there a way to get the WPF RadRichTextBox to spell check Arabic words?  I'm using the .NET 4.0 Q3 2012 version of the WPF components, though I've tried the Q1 2013 release for both .net 4 and .net 4.5 and the issue still remains.
Missing User
 answered on 05 Mar 2014
3 answers
187 views
Hi,

I want to implement a feature to draw an angle's curve between two or more raddiagramconnections connected to a RadDiagramShape. I want to get the following behavior :
-The curve's  visibility is set from a property in the  viewmodel;
- When  add  or remove connections incoming to the raddiagramshape i want to update the RadDiagram automatically and change  the curve including new RadDiagramConnections or excluding removed RadDiagramConnections from  the path;

I want to have a result similar to attached images. Is there a simple way to do this? And Could I have a sample solution with this feature or something of similar??


Thanks
Pavel R. Pavlov
Telerik team
 answered on 05 Mar 2014
2 answers
88 views
Hi All,

How to select ResourceTypeTemplateSelector.MultipleSelectionTemplate?
Kalin
Telerik team
 answered on 05 Mar 2014
4 answers
93 views
Hi,

I am currently using a ChartView control (w/ChartPanAndZoomBehavior) and a Diagram control in my application. Apparently, the mechanism for panning is different between the two controls. In the ChartView, you have to right click and drag to pan, but for the Diagram, you have to ctrl + left click and drag. Going between these two mechanisms can be confusing. Is there any way to set the key combination for panning so that it could be consistent between the controls?

Thanks!
Vivek
Top achievements
Rank 1
 answered on 04 Mar 2014
6 answers
174 views
Hello,
when using the Office2013, the window title is left-aligned.
To be consistent with Office 2013 and the RadRibbonWindow class, it should be centered horizontally.
Patrick
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 04 Mar 2014
1 answer
212 views
Hi Team,

Scenario :

I am working with Radspreadsheet , I need to import the csv files in spreadsheet coming as bytes from backend systems , and again after editing I need to export the csv file as bytes to the backend.

Developed for TEST PURPOSE

I imported a CSV file into spreadsheet from my project physical resources folder ,  I made some changes to that file content .
There is a save button on the wpf page which is exporting the CSV using CSVformatprovider and it is saving the file again to a physical location on my system. Now when I tried to import this updated/saved file using CSVformatprovider import utilty , I am getting some exceptions. [  some tabchange event exception saying object reference not set]

Could you please suggest what to do for this scenario.









Boryana
Telerik team
 answered on 04 Mar 2014
9 answers
1.8K+ views
I have a RadNumericUpDown control that's *typically* used for integer input.  However, on rare occasions, there is a need to enter a floating point value with up to 4 decimal digits - the bound property is actually a FLOAT.

I know I can configure the control with "NumberDecimalDigits=4" and it will work as expected.  However, I dislike the trailing ".0000" that's displayed when the control is being used to enter INT values, which again, is most of the time.

So, is it possible to configure the control to *allow* decimal digits to be entered, but to not display them unless they exist?  So, if I enter an INT, I want it to be displayed as an INT (no decimal digits), and if I enter a FLOAT I want it to be displayed as a float - with all entered decimal digits.

Thanks,

Jeff
Jeff
Top achievements
Rank 1
 answered on 04 Mar 2014
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
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
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
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?