Telerik Forums
UI for WPF Forum
3 answers
235 views
Hi,
I want to "protect" mergefield inside my document, to prevent user to change the display of the field directly in the richtextbox(i use a specific editor to edit the value of my mergefield).

I tried to write a procedure to put or remove readonly on my mergefield, but I have some trouble to make it work :

private void SetMergeFieldReadOnly(MergeField field, RadRichTextBox richTextBox, bool isReadonly)
        {
            var fieldEnd = richTextBox.Document.EnumerateChildrenOfType<FieldRangeEnd>()
                .FirstOrDefault(fs => (fs.FieldRangeStart.Field is MergeField)
                                   && (((MergeField)fs.FieldRangeStart.Field).PropertyPath == field.PropertyPath));
            if (fieldEnd != null)
            {
                var fieldStart = fieldEnd.FieldRangeStart;
                var posFieldStart = new DocumentPosition(richTextBox.Document);
                var posFieldEnd = new DocumentPosition(richTextBox.Document);
                posFieldStart.MoveToInline(fieldStart);
                posFieldEnd.MoveToInline(fieldEnd);
                if (isReadonly) // add readonlyrange
                {
                    richTextBox.Document.Selection.Clear();
                    richTextBox.Document.Selection.SetSelectionStart(posFieldStart);
                    richTextBox.Document.Selection.AddSelectionEnd(posFieldEnd);
                    richTextBox.InsertReadOnlyRange();
                }
                else // remove readonlyrange
                {
                    // 1st method - doesn't work.
                    //richTextBox.Document.Selection.Clear();
                    //richTextBox.Document.Selection.SetSelectionStart(posDebField);
                    //richTextBox.Document.Selection.AddSelectionEnd(posFinField);
                    //richTextBox.DeleteReadOnlyRange();  // <-- no error but the field is still readonly after that.
 
                    // 2nd method - works but not properly
                    var readOnlyRangeStarts = richTextBox.Document.EnumerateChildrenOfType<ReadOnlyRangeStart>();
                    var posDebReadOnly = new DocumentPosition(richTextBox.Document);
                    var posFinReadOnly = new DocumentPosition(richTextBox.Document);
                    foreach (var readOnlyRangeStart in readOnlyRangeStarts)
                    {
                        if (readOnlyRangeStart.End != null)
                        {
                            posDebReadOnly.MoveToInline(readOnlyRangeStart);
                            posFinReadOnly.MoveToInline(readOnlyRangeStart.End);
                            if ((posFinReadOnly >= posFieldStart) && (posDebReadOnly <= posFieldEnd))
                            {
                                richTextBox.DeleteReadOnlyRange(readOnlyRangeStart);   // remove the protection on ALL the readonly range !!!
                            }
                        }
                    }
                }
            }
        }


I wonder if there are not some easier way to do this ? (Or I might be doing something wrong ?)

At the moment, I can only set/unset readonly ALL the mergefield of the document. It works, but sadly it's really slow ...

Are they're some way to "lock" the fields without using some ReadOnlyRange ?

Thanks.
Petya
Telerik team
 answered on 07 May 2013
9 answers
239 views

Hello Telerik team,

 

I’m having trouble with hosting an Addin UI in RadDock.

I wrote a demo to reproduce this issue. download demo here
You can see if you unpin the RadPane, you will no longer be able to focus the textbox. I’m wondering if this is a known issue and is there any workaround for this?


I have read this (http://www.telerik.com/community/forums/wpf/docking/wpf-frame-control-not-visible-in-floating-window.aspx) and this (http://www.telerik.com/community/forums/wpf/docking/radpane-not-displaying-webbrowser-content-while-floating.aspx) threads to make the UI display in RadPane. But when RadPane is in unpinned state, the UI inside it is not able to be used. When I click it, the RadPane automatically hides.

 

 

Miroslav Nedyalkov
Telerik team
 answered on 07 May 2013
2 answers
154 views
Hello,
i want to display a matrix that holds a weighted graph, so for example:
               Point A   Point B    Point C
Point A     10             1          15
Point B     15             8           8
Point C     5               10         1

The pivot control looks very nice and it is also possible to create categories and collapse them, 
but how can i edit the cells? 
It would be enough to double click on a cell and edit it in another window ...
thanks!

Rosen Vladimirov
Telerik team
 answered on 07 May 2013
1 answer
370 views
HI,

i use your AutoCompleteBox from you wpf-example. It works fine. In your "Contatc.cs" are two properties, firstname and lastname.
Your TextSearchParh in the xaml file ist "FirstName".

Is it possible to you both properties "FirstName" and "lastName"??

Thanks
Best Regards
Rene
Vladi
Telerik team
 answered on 07 May 2013
1 answer
208 views
Good afternoon.

Are trying to run an event in instaciado RadWindow inside a usercontrol, but returns me an error: Object reference not set to an instance of an object.

what could be the cause?
Yana
Telerik team
 answered on 07 May 2013
2 answers
124 views
Hi Everyone,

     Is there any way to get the total size (width/height) of columns/rows of a Pivot grid? 
     See attached file.

Thanks,
     
Randell
Top achievements
Rank 1
 answered on 07 May 2013
1 answer
116 views
Hi,

i've got a strange behavior when i try to remove a filter by using RadDataFilter's UI remove button (red cross).
Whenever i remove any CompositeFilter other than the root Filter, i've got the following exception.

System.NullReferenceException wurde nicht von Benutzercode behandelt.
  HResult=-2147467261
  Message=Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
  Source=Telerik.Windows.Controls.Data
  StackTrace:
       bei Telerik.Windows.Controls.Data.DataFilter.CompositeFilterViewModel.get_LogicalOperator() in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Controls\Data\DataFilter\CompositeFilterViewModel.cs:Zeile 47.
  InnerException:

I am using the 2013 Q1 SP1 controls. RadDataFilter is used in "unbound" mode.
The source property ist bound an IEnumrable<T> and AutoGenerateItemPropertyDefinitions is set to true.
The IEnumrable<T> has no items at all. It's only for auto generating the property definitions.
Even if i set no source property on RadDataFilter the above exception is thrown.
My RadDataFilter sits inside a Grid, the Grid itself is hosted by a UserControl which gets injected by Prism Region Manager.
When i use RadDataFilter directly on a Window without any Prism Regions Stuff then there seems to be no problem !?

Kind Regards
Kim 
Rossen Hristov
Telerik team
 answered on 07 May 2013
4 answers
195 views
Hello,
is it in some way possible that RadDataForm uses the IDataErrorInfo interface to validate user input and to show the according error messages?

Regards
Ivan Ivanov
Telerik team
 answered on 07 May 2013
3 answers
194 views
Is it possible to get a contour plot or customize one in telerik chart?
Petar Marchev
Telerik team
 answered on 07 May 2013
1 answer
137 views
I'm using a TextBox in a CellEditing template in a GridView for entering data.

The requirement is that we make sure that when someone clicks into the grid to edit, the data that is already in the text box be selected. Always. Always. The text should ALWAYS be selected when entering edit mode. We NEVER want to see the cursor until at least one new key is hit (arrow key, or other). The text should always be selected.

So I implemented some changes to the text box as outlined here:

http://stackoverflow.com/questions/660554/how-to-automatically-select-all-text-on-focus-in-wpf-textbox

That should in theory work for always selecting the text box.

However, I've found that the Grid View column, when going into edit mode, always UNSELECTS the selection if you click directly on the middle of the text. In other words, it gives me a cursor and no text selection.

Debugging into this, I've found that the culprit comes from one of the GridViewColumn classes calling "PlaceCaretOnTextBox". I want to avoid this.

Is there a setting in the column where I can get it to stop killing the selected text when entering edit mode?


Thanks,
Chad Lehman
20th Century Fox


Chad
Top achievements
Rank 1
 answered on 06 May 2013
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
LayoutControl
ProgressBar
Sparkline
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
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
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?