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

Regd---Selecting half a word.

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.

4 Replies

AD Administrator Syncfusion Team 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;
	}
}


AD Administrator Syncfusion Team 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;
	}
}


MA manohar 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.


AD Administrator Syncfusion Team 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

Loader.
Live Chat Icon For mobile
Up arrow icon