public Editor2(int _userID){ InitializeComponent(); //Set Language this.Language = XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag); //Make RadWindow a normal window (to show taskbar icon etc) RadWindowHelper2 windowHelper = new RadWindowHelper2(); windowHelper.TaskBarDisplayed += new EventHandler(windowHelper_TaskBarDisplayed); windowHelper.ShowWindowInTaskBar(); //Set Document Styles RadDocumentStyles.AddStylesToDocumentRepository(this.radRichTextBox1.Document); //Set dictionary to English GB Stream stream = Application.GetResourceStream(new Uri("en-GB.tdf", UriKind.RelativeOrAbsolute)).Stream; this.LoadDictionary(stream);}public class RadWindowHelper2{ public event EventHandler TaskBarDisplayed; public void ShowWindowInTaskBar() { if (this.TaskBarDisplayed != null) { this.TaskBarDisplayed(this, new EventArgs()); } }}void windowHelper_TaskBarDisplayed(object sender, EventArgs e){ this.Show(); //this.WindowState = WindowState.Maximized; this.BringToFront(); var window = this.ParentOfType<Window>(); window.ShowInTaskbar = true; window.Title = "Template Editor (Printing)";}private void LoadDictionary(Stream tdfFileStream){ RadDictionary dictionary = new RadDictionary(); dictionary.Load(tdfFileStream); ((DocumentSpellChecker)this.radRichTextBox1.SpellChecker).AddDictionary(dictionary, CultureInfo.CurrentUICulture);}For some reason I cannot get both of the above methods to load together.
Here's the exception and stack trace when I try to show a taskbar icon and change the dictionary to en-GB:
Exception:
NullReferenceException was unhandled
Object reference not set to an instance of an object.
stack trace:
call stack:
Telerik.Windows.Documents.dll!Telerik.Windows.Documents.UI.Layers.DecorationUILayerBase.UpdateViewPort(Telerik.Windows.Documents.UI.Layers.UILayerUpdateContext context = {unknown})
Telerik.Windows.Documents.dll!Telerik.Windows.Documents.UI.Layers.TextDecorationLayers.ProofingErrorsDecorationUILayer.ForceUpdateUIViewPort()
Telerik.Windows.Documents.dll!Telerik.Windows.Documents.UI.DocumentPagePresenter.UpdateProofingTextDecoration()
Telerik.Windows.Documents.dll!Telerik.Windows.Documents.UI.DocumentPrintLayoutPresenter.UpdateProofingTextDecoration()
Telerik.Windows.Documents.dll!Telerik.Windows.Controls.RadRichTextBox.InvalidateProofingErrors(bool invalidateIncorrectWordsOnly = {unknown})
Telerik.Windows.Documents.dll!Telerik.Windows.Controls.RadRichTextBox.spellChecker_DataChanged(object sender = {unknown}, System.EventArgs e = {unknown})
Telerik.Windows.Documents.dll!Telerik.Windows.Documents.Proofing.DocumentSpellChecker.OnDataChanged()
Telerik.Windows.Documents.dll!Telerik.Windows.Documents.Proofing.DocumentSpellChecker.AddCustomDictionary(Telerik.Windows.Documents.Proofing.ICustomWordDictionary customDictionary = {unknown}, System.Globalization.CultureInfo culture = {unknown})
Telerik.Windows.Documents.dll!Telerik.Windows.Documents.Proofing.DocumentSpellChecker.AddDictionary(System.Lazy<Telerik.Windows.Documents.Proofing.IWordDictionary> lazyDictionary = {unknown}, System.Globalization.CultureInfo culture = {unknown})
Telerik.Windows.Documents.dll!Telerik.Windows.Documents.Proofing.DocumentSpellChecker.AddDictionary(Telerik.Windows.Documents.Proofing.IWordDictionary dictionary = {unknown}, System.Globalization.CultureInfo culture = {unknown})
> TemplateEditor.exe!TemplateEditor.Editor2.LoadDictionary(System.IO.Stream tdfFileStream = {unknown})
TemplateEditor.exe!TemplateEditor.Editor2..ctor(int _userID = {unknown})
TAS2.exe!TAS2.SpecEditor.btnTemplateEditor_Click(object sender = {unknown}, System.Windows.RoutedEventArgs e = {unknown})
[External Code]
Any advice would be greatly appreciated.
Thanks,
Rob
public class ComboBoxColumn : GridViewBoundColumnBase { ######################shorted############################## public event SelectionChangedEventHandler SelectionChanged; private void OnSelectionChanged( object sender, SelectionChangedEventArgs e ) { var myEvent = this.SelectionChanged; if( myEvent != null ) { myEvent( this, e ); } } private void ComboBoxSelectionChanged( object sender, SelectionChangedEventArgs e ) { this.OnSelectionChanged( sender,e ); } ######################shorted############################## public override FrameworkElement CreateCellEditElement( GridViewCell cell, object dataItem ) { this.BindingTarget = RadComboBox.SelectedValueProperty; var comboBox = new RadComboBox { ItemsSource = this.ItemsSource, DisplayMemberPath = this.DisplayMemberPath, SelectedValuePath = this.SelectedValuePath }; comboBox.SelectionChanged += this.ComboBoxSelectionChanged; comboBox.SetBinding( this.BindingTarget, this.CreateValueBinding( ) ); return comboBox; }<UserControl x:Class="WPFClient.Views.RequestSubmitView" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" xmlns:grid="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView,Version=2012.3.1017.40,Culture=neutral,PublicKeyToken=5803cfa389c90ce7" ><telerik:FilterOperatorConverter x:Key="FilterOperatorConverter1"/><grid:FilterOperatorConverter x:Key="FilterOperatorConverter2" /></ResourceDictionary>public static void SetupGrid(RadGridView gc){ gc.IsFilteringAllowed = false; gc.CanUserSortColumns = false; gc.CanUserSortGroups = false; gc.CanUserReorderColumns = false; gc.CanUserDeleteRows = false; gc.CanUserInsertRows = false; gc.ShowGroupPanel = false; gc.ShowInsertRow = false;}