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---Selecting half a word.

Thread ID:

Created:

Updated:

Platform:

Replies:

35783 Oct 10,2005 09:18 AM UTC Oct 11,2005 10:01 AM UTC WinForms 4
loading
Tags: GridControl
manohar
Asked On October 10, 2005 09:18 AM UTC

Hi Clay, I hope you can give me the solution for this. Actually try selecting three and half a word,you feel a bit difficult in doing so(what i mean is it is selecting the whole word when I trying to select half a word.).Inspite of doing this "this.AutoWordSelection = false" it is still selecting the full word. Cheers, Manohar B.

Administrator [Syncfusion]
Replied On October 10, 2005 10:53 AM UTC

If you set grid.TableStyle.CellType = "OriginalTextBox";, then you will be able to select partical words. This setting changes the default edit control in the cell from a Windows Forms RichTextBox derived control to a Windows Forms TextBox derived control. If you want to teh default cell type for some reason, then try handling CurrentCellControlGotFocus and set the property there.
this.gridDataBoundGrid1.CurrentCellControlGotFocus += new ControlEventHandler(gridDataBoundGrid1_CurrentCellControlGotFocus);

private void gridDataBoundGrid1_CurrentCellControlGotFocus(object sender, ControlEventArgs e)
{
	if(e.Control is RichTextBox)
	{
		RichTextBox rtb = e.Control as RichTextBox;
		rtb.AutoWordSelection = false;
	}
}

Administrator [Syncfusion]
Replied On October 10, 2005 05:52 PM UTC

If you set grid.TableStyle.CellType = "OriginalTextBox";, then you will be able to select partial words. This setting changes the default edit control in the cell from a Windows Forms RichTextBox derived control to a Windows Forms TextBox derived control. If you want to keep using RichTextBox cell type for some reason, then try handling CurrentCellControlGotFocus and set the property there.
this.gridDataBoundGrid1.CurrentCellControlGotFocus += new ControlEventHandler(gridDataBoundGrid1_CurrentCellControlGotFocus);

private void gridDataBoundGrid1_CurrentCellControlGotFocus(object sender, ControlEventArgs e)
{
	if(e.Control is RichTextBox)
	{
		RichTextBox rtb = e.Control as RichTextBox;
		rtb.AutoWordSelection = false;
	}
}

manohar
Replied On October 11, 2005 05:07 AM UTC

Hi Clay, The first option is ruled out because other features of my richtextbox will go for a toss if I make CellType as OriginalTextBox.Comming to the second option I tried but it didn''t work. Thanks & Regards, Manohar B.

Administrator [Syncfusion]
Replied On October 11, 2005 10:01 AM UTC

The code I gave you works if you set the celltype = "TextBox". If you are trying to use celltype = "RichText", then I do not know of a simple way to get this property set as that control uses interop to do the richtext drawing. If you use the richtext celltype from this kb, then you can set the property. http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=71 Here is the code from that kb modified so you can select partial words in a Richtext cell. http://www.syncfusion.com/Support/user/uploads/RichTextInPlaceCellContol_40a785c4.zip

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

;