We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

convert points to current col/row

I'd like to select a block of text and insert text before and after. I see API's to convert current col to top/bottom coordinates. The select returns coordinates. How do I convert them to row/column for the sake of inserting?

Thanks.

3 Replies

AD Administrator Syncfusion Team January 12, 2007 05:13 PM UTC

Hi David,

Our apologies for the delayed response. It is possible to convert CoordinatePoint to row and column. I have attached a sample that illustrates this. Let me know if this meets your requirements.

Thanks for your patience.

Regards,
Ebenezer.P

sample


DU David Union January 12, 2007 07:28 PM UTC

Thanks for the help so far, this got me about 60%. On a context menu handler I did:

int startLine=this.editControl1.Selection.Start.VirtualLine;
int startColumn=this.editControl1.Selection.Start.VirtualColumn;
int endLine=this.editControl1.Selection.End.VirtualLine;
int endColumn=this.editControl1.Selection.End.VirtualColumn;
this.editControl1.InsertText(endLine,endColumn,"#endregion");
this.editControl1.InsertText(startLine,startColumn,"#region");


I'm trying to add these (comment) tags around the block of selected text. This works if the user is careful to select whole rows. But if they select part of a row, for example the middle of a row, it puts the stuff before the row. If they go from the beginning of one row the the end of the next, but not to the beginning of the next line, that is 'still on the prior line', it causes the syncfusion parse engine to crash.

Do you want an update of my xml config file to see if there is some connection?

My reason for trying to do the 'end' first was the assumption that once I insert, the lines move down, and the old 'end' block will have changed, but the offset to the 'start' block should not have.

>Hi David,

Our apologies for the delayed response. It is possible to convert CoordinatePoint to row and column. I have attached a sample that illustrates this. Let me know if this meets your requirements.


DU David Union January 12, 2007 07:42 PM UTC

Actually thanks, I've got it all working OK
now. This was exactly what I was looking for.

David Union


>Hi David,

Our apologies for the delayed response. It is possible to convert CoordinatePoint to row and column. I have attached a sample that illustrates this. Let me know if this meets your requirements.

Thanks for your patience.

Regards,
Ebenezer.P

sample

Loader.
Live Chat Icon For mobile
Up arrow icon