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.

Regd---Selecting half a word.

Thread ID:

Created:

Updated:

Platform:

Replies:

35783 Oct 10,2005 05:18 AM Oct 11,2005 06:01 AM Windows Forms 4
loading
Tags: GridControl
manohar
Asked On October 10, 2005 05:18 AM

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 06:53 AM

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 01:52 PM

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 01:07 AM

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 06:01 AM

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.

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.

;