private void radButtonElement1_Click(object sender, EventArgs e) { this.radRichTextBox1.ChangeTextHighlightColor(System.Drawing.Color.White); this.radRichTextBox1.Document.Selection.Clear(); this.radRichTextBox1.Document.Selection.AddSelectionStart(myNewSentenceStartPos); myEndPos.MoveToCurrentWordEnd(); do { string word = myStartPos.GetCurrentSpanBox().Text; if (word.Contains(".")) { DocumentPosition wordEndPosition = new DocumentPosition(myStartPos); wordEndPosition.MoveToCurrentWordEnd(); this.radRichTextBox1.Document.Selection.Clear(); this.radRichTextBox1.Document.Selection.AddSelectionStart(myNewSentenceStartPos); this.radRichTextBox1.Document.Selection.AddSelectionEnd(wordEndPosition); this.radRichTextBox1.ChangeTextHighlightColor(System.Drawing.Color.Aqua); myStartPos = myEndPos; myNewSentenceStartPos = myEndPos; break; } else { } } while (myStartPos.MoveToNextWordStart()); }
Here is the crash report:
System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
bei Telerik.WinControls.RichTextBox.FileFormats.OpenXml.Docx.StyleRepository.EvaluateProperty[T](Style elementStyle, Style parentStyle, Object propertyKey, T defaultValue)
bei Telerik.WinControls.RichTextBox.FileFormats.OpenXml.Docx.StyleRepository.EvaluateProperty[T](Style elementStyle, Object propertyKey, T defaultValue)
bei Telerik.WinControls.RichTextBox.FileFormats.OpenXml.Docx.Import.ParagraphImporter.ApplyStyle(Paragraph paragraph, StyleRepository styleRepository, Style style)
bei Telerik.WinControls.RichTextBox.FileFormats.OpenXml.Docx.Import.TableImporter.ApplyBlockStyle(TableCell cell, Style style)
bei Telerik.WinControls.RichTextBox.FileFormats.OpenXml.Docx.Import.TableImporter.ApplyConditionalStyle(TableCell cell, TableStyleConstrains availableStyles, Int32 currentRowIndex, Int32 currentColumnIndex)
bei Telerik.WinControls.RichTextBox.FileFormats.OpenXml.Docx.Import.TableImporter.ApplyConditionalStyle(Table table, Style style)
bei Telerik.WinControls.RichTextBox.FileFormats.OpenXml.Docx.Import.TableImporter.Import(Style parentStyle)
bei Telerik.WinControls.RichTextBox.FileFormats.OpenXml.Docx.Import.MainDocumentImporter.BuildBody()
bei Telerik.WinControls.RichTextBox.FileFormats.OpenXml.Docx.Import.MainDocumentImporter.BuildDocument()
bei Telerik.WinControls.RichTextBox.FileFormats.OpenXml.Docx.Import.DocxImporter.Import()
bei TelerikEditor.MainForm.OpenDocument()
bei Telerik.WinControls.UI.BackstageButtonItem.OnClick(EventArgs e)
bei Telerik.WinControls.RadItem.DoClick(EventArgs e)
bei Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
bei Telerik.WinControls.ComponentInputBehavior.OnMouseUp(MouseEventArgs e)
bei Telerik.WinControls.RadControl.OnMouseUp(MouseEventArgs e)
bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei Telerik.WinControls.RadControl.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Telerik.WinControls.RichTextBox.FormatProviders.IDocumentFormatProvider p = new Telerik.WinControls.RichTextBox.FileFormats.Html.HtmlFormatProvider();
Telerik.WinControls.RichTextBox.Model.RadDocument document = p.Import(System.Text.Encoding.UTF8.GetBytes(pBody));document.CaretPosition.MoveToLastPositionInDocument();document.InsertLineBreak();document.Insert(pNote, style);
protected void CellEndEdit(object sender, GridViewCellEventArgs e){ Save(e.Row.DataBoundItem); if (e.Row is GridViewNewRowInfo) { Debug.WriteLine("Attempting refresh"); SendKeys.Send("{UP}"); }}private void PupilGrid_ValueChanged(object sender, EventArgs e) { //set a processing flag as if the select all checkbox is used this //event fires for every checkbox in the column! if (_populatingParentGrid) return; _populatingParentGrid = true; if (sender.GetType() == typeof(GridViewCellInfo)) { //this means the select all box has been checked RefreshParentGrid(true); } else if (sender.GetType() == typeof(RadCheckBoxEditor)) { //single box checked RefreshParentGrid(false); } }private void ParentGrid_DataBindingComplete(object sender, GridViewBindingCompleteEventArgs e) { //reset processing flag _populatingParentGrid = false; //PupilGrid.Enabled = true; }private void checkbox_ToggleStateChanged(object sender, StateChangedEventArgs args) { if (suspendProcessingToggleStateChanged) return; bool valueState = false; if (args.ToggleState == ToggleState.On) { valueState = true; } GridViewElement.EditorManager.EndEdit(); TableElement.BeginUpdate(); foreach (GridViewRowInfo t in ViewInfo.Rows) { t.Cells[ColumnIndex].Value = valueState; } TableElement.EndUpdate(false); TableElement.Update(GridUINotifyAction.DataChanged); //Need to raise an event here to say that the processing has finished }private void AddCheckColumn() { //Telerik code - see above for link var checkColumn = new CustomCheckBoxColumn {Name = "Select", HeaderText = "All", ReadOnly = false}; //No suitable events found here PupilGrid.Columns.Insert(0, checkColumn); var checkColumn2 = new CustomCheckBoxColumn {Name = "Select", HeaderText = "All", ReadOnly = false}; ParentGrid.Columns.Insert(0, checkColumn2); }Load event:
Dim ListDisplayColumn As GridViewComboBoxColumn = dgvReportingIndicators.Columns("ListSwitchDisplay") ListDisplayColumn.DataSource = Me.TrafficLightIndicatorsTableAdapter.GetData ListDisplayColumn.DisplayMember = "DisplayName" ListDisplayColumn.FieldName = "ListSwitch" ListDisplayColumn.ValueMember = "ID"If e.Column.Name = "ListSwitchDisplay" Then Dim dropDownEditor = TryCast(dgvReportingIndicators.ActiveEditor, RadDropDownListEditor) Dim element = TryCast(dropDownEditor.EditorElement, RadDropDownListEditorElement) Select Case e.Row.Cells("IndicatorTypeDisplay").Value Case "Count" element.DataSource = Me.TrafficLightIndicatorsTableAdapter.GetNotApplicable Case "Traffic Light" element.DataSource = Me.TrafficLightIndicatorsTableAdapter.GetTL End Select element.ShowPopup() End If
protected override Image GetDragHintCore() { Debug.WriteLine("GetDragHintCore"); return GetAsBitmap(Brushes.Yellow, 2, new SizeF(48, 48)); }