I sent a support ticket to the telerik admins asking if there were any API methods to determine if the caret is at the start and end of a line.
They responded with a solution so I thought I should share it with everyone else.
Is Caret at Line Start
public static bool IsCaretAtLineStart(RadDocument document){ DocumentPosition endLinePosition = new DocumentPosition(document.CaretPosition); endLinePosition.MoveToCurrentLineStart(); if (document.CaretPosition == endLinePosition) { return true; } return false;}
Is Caret at Line End
public static bool IsCaretAtLineEnd(RadDocument document){ DocumentPosition endLinePosition = new DocumentPosition(document.CaretPosition); endLinePosition.MoveToCurrentLineEnd(); if (document.CaretPosition == endLinePosition) { return true; } return false;}
I hope this helps you as it did myself.
Thanks,
Rob