Telerik Forums
UI for WPF Forum
1 answer
167 views
I try to do this by using this Thread's Posts but when I Paste Some text contain hyperlink in my RadRichTextBox , It shows the hyperlinks as usual way and doesn't remove Its styles and etc.
I Want remove any styles, Images, Tables, Bullets, etc of document's content like when paste Clipboard in TextBox.
Petya
Telerik team
 answered on 29 Oct 2012
1 answer
99 views
Hi,

I seem to get a NullReferenceException from time to time when I assisigning the ScrollBarValueChanged event. It doesn't always throw the exception, and I can't quite work out how this is happening.
this.radRichTextBox.VerticalScrollBar.ValueChanged += radRichTextBox_ScrollBarValueChanged;


I assigned it in my RadRichTextbox loaded event:
private void radRichTextBox_Loaded(object sender, RoutedEventArgs e)
{
            //Set ListBoxItems
            AutoCompleteSetListBoxItems(1);
            //Set Autocomplete ListBox itemssource
            radListBox.ItemsSource = autoCompleteListItems;
 
            //Assign DocumentArranged event. This will in turn enable document changed event.
            this.radRichTextBox.DocumentArranged += radRichTextBox_DocumentArranged;
 
            //Assign CommandExecuting Event. This will catch cut, copy, paste etc
            this.radRichTextBox.CommandExecuting += radRichTextBox_CommandExecuting;
 
            //Assign Scroll Event To Reposition Popup AutoComplete Window
            this.radRichTextBox.VerticalScrollBar.ValueChanged += radRichTextBox_ScrollBarValueChanged;
}



Here's the stack trace:

   at TAS2.RadRichTextBoxAutoComplete.radRichTextBox_Loaded(Object sender, RoutedEventArgs e) in C:\TAS2 - Q3 2012\TAS2\RadRichTextBoxAutoComplete.xaml.cs:line 195
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
   at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
   at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
   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.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   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.InvokeImpl(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.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at System.Windows.Application.Run()
   at TAS2.App.Main() in C:\TAS2 - Q3 2012\TAS2\obj\x86\Debug\App.g.cs:line 0



System.Reflection.RuntimeMethodInfo:
{Void radRichTextBox_Loaded(System.Object, System.Windows.RoutedEventArgs)}


Has anyone come across this error before?

Thanks for your time,

Rob

Petya
Telerik team
 answered on 29 Oct 2012
2 answers
186 views
Hello,

I'm looking for a way to disable the default Ctrl+V behavior, which simply creates a blank appointment (bypassing all validation).  I tried defining my own command bindings to override the default behavior as exemplified in the sample project included in this post  http://www.telerik.com/community/forums/silverlight/scheduleview/copy-paste-appointment.aspx;  however, I cannot find the appropriate namespace for CommandManager.SetCommandBindings().  System.Windows.Input.CommandManager does not contain a definition for SetCommandBindings, and I cannot find CommandManager under Telerik.Windows.Controls.   Likewise, when specifying <telerik:CommandManager.InputBindings> in XAML, I get 'The attachable property InputBindings was not found in type CommandManager'.  Am I missing something or is this only meant to work in Silverlight? 

I'm using the latest Q3 release.

Thanks in advance..
Vic
Vic
Top achievements
Rank 1
Iron
 answered on 29 Oct 2012
2 answers
143 views
How can I determin in code which column is sorted in a RadGridView?
This always returns null

if (grid.CurrentColumn != null)
{
    DoSomething
}
else
    MessageBox.Show("No column selected");
Jeff
Top achievements
Rank 1
 answered on 29 Oct 2012
1 answer
65 views
I have a GridView with a GridViewDataColumn, EditTriggers is set to TextInput and F2. I select a cell and begin typing input. When the first character is entered it becomes highlighted essentially causing me to override the first letter with any subsequent characters. 

Essentially the same problem as in http://www.telerik.com/community/forums/winforms/gridview/editmode-rewrites-first-character.aspx

But that post says the issue has been addressed so possibly a different bug?
Yoan
Telerik team
 answered on 29 Oct 2012
2 answers
107 views

r.a.d.datepicker dont support other language date!!!

Dotnetnuke use this plugin in core va date use this object but dont can use this object for show date

r.a.d.datepicker dont support 1400 year or dates under 1980
when this bug is fix ?????????

arash
Top achievements
Rank 1
 answered on 29 Oct 2012
2 answers
93 views
When I open my project it is constantly reminding me that my project doesn't use the latest version of the WPF controls. But I can't seem to permanently turn off this notification. I can only tell it to remind me later.

Is there away to tell the extension not to remind me again for this project? When the time comes that I want/need to update, I will do a manual update. This project is source controlled on TFS so I'd rather not use an automatic update.
Rayne
Top achievements
Rank 1
 answered on 29 Oct 2012
0 answers
492 views
The new update to my trial version contains binaries for WPF40 and WPF45.  I am using VS 2010.  Which should I use; WPF40 or WPF45?
Rob
Top achievements
Rank 1
 asked on 29 Oct 2012
3 answers
155 views
There seems to be a Bug within the MaskedTextInputControl. When I set the Mask to Alphanumeric ( f.e. a20 ) I can hit return to break the line. When Setting Mask to literals ( f.e. l20 ) this behavior disappers.

Is there a known workaround so I can set my TextInput to alphanumeric without being able to break the line ?

Bug can be easily reproduced at the Demo

See here : http://s1.directupload.net/file/d/3048/o8ymta7s_jpg.htm
Tina Stancheva
Telerik team
 answered on 29 Oct 2012
0 answers
199 views
What's wrong with this code???
why binding doesn't work???
Check the attachment.


public class UcMetadataPropertyGrid : RadPropertyGrid
    {
        public UcMetadataPropertyGrid(MetadataCollection col)
        {
            foreach (Metadata data in col)
            {
                PropertyDefinition def = new PropertyDefinition();
                def.DisplayName = data.Name;
                //def.Binding = new Binding("StringValue");
                //def.Binding.Source = data;
                //def.Binding.Mode = BindingMode.TwoWay;
                def.EditorTemplate = CreateEditor(data);
                this.PropertyDefinitions.Add(def);
            }
        }

        private DataTemplate CreateEditor(Metadata metadata)
        {
            var dt = new DataTemplate();
            var textbox = new RadWatermarkTextBox() { Name = "cp" };
            textbox.Text = "{Binding Path=StringValue}";
            var binding = new Binding
            {
                Path = new PropertyPath("StringValue"),
                Mode = BindingMode.TwoWay,
                UpdateSourceTrigger = UpdateSourceTrigger.LostFocus,
                Source = metadata
            };
            textbox.SetBinding(Metadata.StringValueProperty, binding);

            //dt.VisualTree = textbox;
            //dt.Seal();
            return dt;
        }

        private DataTemplate CreateEditor()
        {
            var sb = new StringBuilder();
            sb.Append("<DataTemplate ");
            sb.Append("xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' ");
            sb.Append("xmlns:controls='clr-namespace:Nezam.DigitalVideoArchive.UI.Controls;assembly=Nezam.DigitalVideoArchive.UI' ");
            sb.Append("xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'>");
            sb.Append("<Grid>");
            sb.Append(@"<TextBox Text=""{Binding StringValue,Mode=TwoWay}"" />");
            sb.Append("</Grid>");
            sb.Append("</DataTemplate>");
            
            return (DataTemplate)System.Windows.Markup.XamlReader.Parse(sb.ToString());
        }
    }



public MainWindow()
        {
            InitializeComponent();

            MetadataCollection col = new MetadataCollection();

            StringMetadata sm = new StringMetadata();
            sm.Name = "StringMetadata";
            sm.StringValue = "Amin";
            col.Add(sm);

            BoolMetadata bm = new BoolMetadata();
            bm.Name = "BoolMetadata";
            bm.Value = true;
            col.Add(bm);

            GuidMetadata gm = new GuidMetadata();
            gm.Name = "GuidMetadata";
            gm.Value = Guid.NewGuid();
            col.Add(gm);

            DateTimeMetadata dm = new DateTimeMetadata();
            dm.Name = "DateTimeMetadata";
            dm.Value = DateTime.Now;
            col.Add(dm);


            UcMetadataPropertyGrid pg = new UcMetadataPropertyGrid(col);
            //pg.FlowDirection = System.Windows.FlowDirection.RightToLeft;
            this.Grid1.Children.Add(pg);
        }
Amin
Top achievements
Rank 1
 asked on 29 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?