Telerik Forums
UI for WPF Forum
3 answers
245 views
I came across a strange case when I was writing code for saving FilterDescriptors settings for RadDataFilter. The default value for string filter editor is OperatorValueFilterDescriptorBase.UnsetValue, the FilterDescriptor.Value is equal to OperatorValueFilterDescriptorBase.UnsetValue (FilterDescriptor .Value == OperatorValueFilterDescriptorBase.UnsetValue). When I save and read this value from isolated storage is not equal to OperatorValueFilterDescriptorBase.UnsetValue. See example bellow.

The following example is completely useless but it shows error.

MainWindow.xaml:
<Window x:Class="TestTelerikWpfApp.MainWindow"
        xmlns:local="clr-namespace:TestTelerikWpfApp"
        Title="MainWindow" Height="300">
    <Window.Resources>
    </Window.Resources>
    <StackPanel>
        <TextBox telerik:PersistenceManager.StorageId="textBox" />
        <StackPanel Orientation="Vertical">
            <telerik:RadButton Content="Save" Click="SaveButton_Click" />
            <telerik:RadButton Content="Read" Click="ReadButton_Click" />
        </StackPanel>
    </StackPanel>
</Window>

MainWindow.xaml.cs
namespace TestTelerikWpfApp
{
    using System.Windows;
    using System.Windows.Controls;
    using Telerik.Windows.Persistence.Services;
    using Telerik.Windows.Persistence.Storage;
 
    public partial class MainWindow : Window
    {
        private IsolatedStorageProvider isoProvider;
 
        public MainWindow()
        {
            InitializeComponent();
 
            ServiceProvider.RegisterPersistenceProvider<ICustomPropertyProvider>(typeof(TextBox), new UnsetValuePropertyProvider());
 
            isoProvider = new IsolatedStorageProvider();
        }
 
        private void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            isoProvider.SaveToStorage();
        }
 
        private void ReadButton_Click(object sender, RoutedEventArgs e)
        {
            isoProvider.LoadFromStorage();
        }
    }
}

For one TextBox I save or read data to isolated storage.

UnsetValuePropertyProvider.cs:
namespace TestTelerikWpfApp
{
    using Telerik.Windows.Data;
    using Telerik.Windows.Persistence.Services;
 
    class UnsetValuePropertyProvider : ICustomPropertyProvider
    {
        public CustomPropertyInfo[] GetCustomProperties()
        {
            return new CustomPropertyInfo[]
            {
                new CustomPropertyInfo("UnsetValue", typeof(UnsetValueProxy))
            };
        }
 
        public void InitializeObject(object context)
        {
        }
 
        public object InitializeValue(CustomPropertyInfo customPropertyInfo, object context)
        {
            return null;
        }
 
        public object ProvideValue(CustomPropertyInfo customPropertyInfo, object context)
        {
            return new UnsetValueProxy() { Value = OperatorValueFilterDescriptorBase.UnsetValue };
        }
 
        public void RestoreValue(CustomPropertyInfo customPropertyInfo, object context, object value)
        {
            var unsetValueProxy = value as UnsetValueProxy;
            var isUnsetValueSame = unsetValueProxy.Value == OperatorValueFilterDescriptorBase.UnsetValue; // isUnsetValueSame = false !!!
        }
    }
}

UnsetValueProxy.cs:
namespace TestTelerikWpfApp
{
    class UnsetValueProxy
    {
        public object Value { get; set; }
    }
}

In ProvideValue method I pass to proxy object OperatorValueFilterDescriptorBase.UnsetValue value and in RestoreValue unsetValueProxy.Value is not equal to OperatorValueFilterDescriptorBase.UnsetValue and it should be. See also locals tab in debug mode (example.png).
Pawel
Top achievements
Rank 1
 answered on 04 Dec 2014
4 answers
231 views
Hi,

What are the localization strings to datetimepicker - navigation popup controls (Close-button, Clock) ?

I'm using RadControls for WPF (WPF40_2011_2_0712)

Regards,
Auvo
Yana
Telerik team
 answered on 04 Dec 2014
0 answers
250 views
I'd like to filter out hyperlinks when the user pastes into a RadRichTextBox editor control.   We are using RichTextBoxUI.dll from UI for WPF version 2014.2.617.40.

The examples found the following threads set e.Cancel = true to cancel the paste operation. 
e.Cancel is not visible in Telerik.Windows.Controls.RichTextBoxUI.DLL v2014.2.617.40 
How can the paste command be cancelled?  For example, cancel any paste command with an image in it.

The second related thread has this sample code to remove hyperlinks.
void radRichTextBox_CommandExecuting(object sender, Telerik.Windows.Documents.RichTextBoxCommands.CommandExecutingEventArgs e)
{    
   if (e.Command is PasteCommand)    
    {        
              DocumentFragment fragment = ClipboardEx.GetDocument();        
              if (fragment != null)        
               {            
                        TxtFormatProvider provider=new TxtFormatProvider();            
                        string plainText = provider.Export(fragment.ToDocument());            
                        this.radRichTextBox.InsertFragment(new DocumentFragment(provider.Import(plainText)));
                        e.Cancel = true;        
                }    
    }
}

Related threads:
- How to paste plain text http://www.telerik.com/forums/paste-plain-text
- How to remove hyperlinks http://www.telerik.com/forums/remove-hyperlinks-when-executing-pastecommand
- Preventing paste of images http://www.telerik.com/forums/limiting-the-radrichtextbox (Silverlight)

​
C
Top achievements
Rank 1
 asked on 03 Dec 2014
4 answers
135 views
Dear support,

is there a way to validate the users input? For example I only want to accept inputs of CellValueType.Number. Is it possible?

Thanks in advance

Marcus
Marcus
Top achievements
Rank 1
 answered on 03 Dec 2014
4 answers
288 views
We have noticed that rectangular shapes is incorrectly rendered on
resize. Following code expected to add to the diagram resizable straight
rectangle:

 

           
diagram.AddShape(new RadDiagramShape

                            
{

                                
Geometry = geometry,

                                 BorderBrush
= Brushes.Green,

                                 StrokeThickness
= thickness,

                                 Position
= new Point(50, 50),

                                 Background
= Brushes.Transparent

                            
});

 

           
Instead it draws rectangle with excluded corners.

Moreover if rectangle is been resized user can see strange effect when set and configuration of excluded
corners are changing. See it in action on this video: https://www.youtube.com/watch?v=dK4mXmlEOhc

We are using Telerik WPF
2013.3.1016.40

How resolve this error?
It depends on RadiusX, RadiusY (e.g. there are less cut corners when both set to 0.009), but never completely resolved.

 

Please help us to workaround
this problem in version we use.
Martin Ivanov
Telerik team
 answered on 03 Dec 2014
4 answers
445 views
Hi all!
In our project, we need to draw a curves on the map. Moreover, a dotted curves.
I've attached a cut of the design, so you can see what I want.

How can I do that ?
I've tried to inherit from MapLine, but that class is not inherit-friendly, almost sealed. So I failed
Petar Mladenov
Telerik team
 answered on 03 Dec 2014
1 answer
183 views
Hello,

is there a possibility to have a different design from the summary task when it is collapsed?
The goal is to have two designs depending on the summary expanded/collapsed state.
In collapsed state it should look like a normal gantttaskbar. In expanded state like current
summary task design.

Regards,
Richard




​
Polya
Telerik team
 answered on 03 Dec 2014
1 answer
772 views
I was surprised to not find a media player in Telerik UI for WPF.

Is there a way to use the RadMediaPlayer from Telerik UI for Silverlight in a WPF application.
Pavel R. Pavlov
Telerik team
 answered on 03 Dec 2014
1 answer
597 views
I was surprised to find no media player in Telerik UI for WPF.  

Is there a way to use the Silverlight RadMediaPlayer?
Pavel R. Pavlov
Telerik team
 answered on 03 Dec 2014
1 answer
106 views
Is there a way on the GridView to have a "blank" new row, rather than a clickable button?

I think the standard WPF DataGrid does this by default.
Maya
Telerik team
 answered on 03 Dec 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
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
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
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
InlineAIAssistant
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?