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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Selected text within a cell

Thread ID:

Created:

Updated:

Platform:

Replies:

77051 Oct 9,2008 10:33 PM Oct 16,2008 04:44 AM Windows Forms 1
loading
Tags: GridControl
Dewitt Blankenship
Asked On October 9, 2008 10:33 PM

How do I get/set the selected text within a textbox cell? Related to that, how do I get/set the caret position within the textbox?


Jisha Joy [Syncfusion]
Replied On October 16, 2008 04:44 AM

Hi,

We appreciate your interest in Syncfusion Products.

The selected Text from Grid Cell.

Thix=s can be achieved by handling the CurrentCellActivated event and getting the CurrentCell Renderer. Please refer the code:

void gridControl1_CurrentCellActivated(object sender, EventArgs e)
{
GridCellRendererBase tbr = null;
tbr = this.gridControl1.CurrentCell.Renderer;
string str;
tbr.GetSelectedText(out str);
this.label1.Text = str;
}


Regarding Caret position

This can be achieved by setting the ActivateCurrentCellBehavior property. Please refer the code:

this.gridControl1.ActivateCurrentCellBehavior = GridCellActivateAction.PositionCaret;

Please try this and let me know if this helps.

Regards,
Jisha


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

;