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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

REGD--Locating the current position

Thread ID:

Created:

Updated:

Platform:

Replies:

35065 Sep 22,2005 05:40 AM UTC Sep 27,2005 11:39 AM UTC WinForms 3
loading
Tags: GridControl
manohar
Asked On September 22, 2005 05:40 AM UTC

Hi There, I would like to drag(source) some text in Richtextbox and drop in the same Richtextbox but in some other location.How to find the cursor position(destination) while dropping.(i.e) where he is dropping that cursor position I want.Kindly someone help me out. Thanks in advance, Cheers, Manohar.

Administrator [Syncfusion]
Replied On September 23, 2005 12:48 PM UTC

Hi Manohar, You could try this code snippet and see if this helps. private void gridControl1_DragDrop(object sender, System.Windows.Forms.DragEventArgs e) { Point pt = this.gridControl1.PointToClient(Control.MousePosition); int rowIndex, colIndex; this.gridControl1.PointToRowCol(pt, out rowIndex, out colIndex); Console.WriteLine("Drop Row"+rowIndex); Console.WriteLine("Drop col"+colIndex); } Here is the sample. RichTextDrop_3893.zip Let us know if this helps. Best Regards, Jeba.

manohar
Replied On September 26, 2005 08:58 AM UTC

Hi Jeba, Actually you have misunderstood my requirement.I am using "GridDataBoundGrid" , in that one cell bahaves as RichTextCell(i.e., CellType is RichTextCell).Now the difficulty starts...remember everything happens in that cell only.For your info its multiline.First I will select some text,I will drag it,I will drop it somewhere in the same cell(remember same cell),now my question is how to know the destination point and in which event i need to write that. Note:Every word is important in this.In all other scenarios it''s working fine,that''s why i am telling like this. Thanks in advance, Regards, Manohar.

Administrator [Syncfusion]
Replied On September 27, 2005 11:39 AM UTC

Hi Manohar, Drag and drop within the same Richtext cell is not supported, only copy and paste is supported out of the RichText box. The reason for this is that the Windows Forms RichTextBox does not support Drag and Drop, only copy paste. If you want this support, you could try to derive a custom cell type to support D&D. First you could try to get D&D working with a richtextbox sitting on a form. After that please try to implement that richtextbox in a grid cell. The richtextbox has methods that map a point to a char: rtb.GetCharFromPosition rtb.GetCharIndexFromPosition Regards, Jeba.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;