Get Table Position

2 posts, 0 answers
  1. Tarak
    Tarak avatar
    1 posts
    Member since:
    Jan 2013

    Posted 31 Jan 2013 Link to this post


    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.

  2. Svett
    Svett avatar
    728 posts

    Posted 04 Feb 2013 Link to this post

    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.

    the Telerik team
    Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
Back to Top