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

text select bug and semi-related question

Thread ID:

Created:

Updated:

Platform:

Replies:

10634 Feb 8,2004 12:51 PM UTC Feb 8,2004 04:25 PM UTC WinForms 2
loading
Tags: GridControl
Andy Barnhart
Asked On February 8, 2004 12:51 PM UTC

If I have text in a cell that has a worf eding in a single quote like: auditors'' in the middle of a sentence, when I double click on that word it does not select the word; it selects the quote and the space after it. My related question - how can I deselect all text when the cell first gets focus? I have tried using the GridAwareTextBox.Select(0,0) after wiring it to the grid on all manner of events and not having any luck. The issue is that when a user first sets focus (often by clicking on expand or collapse) it selects all text by default, so if the user presses any key it wipes it all out.

Administrator [Syncfusion]
Replied On February 8, 2004 01:40 PM UTC

How the currentcell handles the text when it becomes active normally is controlled by the ActivateCurrentCellBehavior property of the grid. If you are seeing it normally selectall, then I suspect this property has been explicitly set to GridCellActivateAction.SelectAll. There are some exceptions (like CurrencyEdit celltypes). The behavior I see is double-clicking on the quote or the space selects the quote+space, but double-clicking on any letter in author, selects author. It does this because that is the default behavior of the System.Windows.Forms.RichTextBox on which our "TextBox" celltype is based. If you want the behavior of System.Windows.Forms.TextBox (which will select author when you click on the quote or the space), then you can change the celltype to "OriginalTextBox" which is based on the Windows Forms TextBox. Another option that lets you customize what a double click does is to handle this event and explcitly select what you want selected. private void gridDataBoundGrid1_CurrentCellControlDoubleClick(object sender, System.Windows.Forms.ControlEventArgs e) { GridTextBoxControl tb = e.Control as GridTextBoxControl; if(tb != null) { //select whatever you want tb.SelectAll(); } }

Andy Barnhart
Replied On February 8, 2004 04:25 PM UTC

It wasn''t set to SelectAll; it was set to ClickOnCell. But trying the valuse there, it turned out that "SetCurrent" does what I want. Thanks. On the other matter, I don''t think you understand what I was "saying". If the word auditors'' (with a signle quote at the end) is in the text and I double click on the letter u (or pretty much anywhere_, it selects the quote and the space after it only, not the letters in the word. It''s a very minor bug, but I wanted to report it rather than ignore it. BTW, my evaluation of your product is going better than it may seem. I pick nits and no one gets a perfect score. Getting support on a Sunday was unexpected and a big positive.

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

;