This is a migrated thread and some comments may be shown as answers.

Get Table Position

1 Answer 72 Views
RichTextBox (obsolete as of Q3 2014 SP1)
This is a migrated thread and some comments may be shown as answers.
Tarak
Top achievements
Rank 1
Tarak asked on 31 Jan 2013, 10:16 AM
Hi,

I want to know if there is any way to check whether the caret is currently in a table or not in rich text box.

Regards,
Tarak

1 Answer, 1 is accepted

Sort by
0
Svett
Telerik team
answered on 04 Feb 2013, 05:22 PM
Hi Tarak,

You should use the PositionChanged event of the CaretPosition property of the RadDocument instance:

this.radRichTextBox1.Document.CaretPosition.PositionChanged += new System.EventHandler(CaretPosition_PositionChanged);

private void CaretPosition_PositionChanged(object sender, System.EventArgs e)
{
    TableCellLayoutBox cellLayoutBox = this.radRichTextBox1.Document.CaretPosition.GetCurrentTableCellBox();
 
    if (cellLayoutBox != null)
    {
        // TO DO
    }
}

I hope this helps.

Greetings,
Svett
the Telerik team
Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
Tags
RichTextBox (obsolete as of Q3 2014 SP1)
Asked by
Tarak
Top achievements
Rank 1
Answers by
Svett
Telerik team
Share this question
or