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

Selection of text in current cell

Thread ID:

Created:

Updated:

Platform:

Replies:

29278 May 20,2005 05:25 PM UTC May 21,2005 12:10 AM UTC WinForms 1
loading
Tags: GridControl
Jeff Lancaster
Asked On May 20, 2005 05:25 PM UTC

Hello, I am using the following code in my GDBG so that when cell validation fails, it will display an error message and then highlight all the text in the current cell. It works fine if the user tries to tab or enter out of the cell, but if the user clicks on another cell, the message is displayed, however the text does not get highlighted. I tried playing with the "focus" method but haven''t had any luck yet. Suggestions? Private Sub m_grid_ValidateFailed(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridValidateFailedEventArgs) Handles m_grid.ValidateFailed Dim cc As GridCurrentCell = m_grid.CurrentCell cc.ErrorMessage = "Invalid value for " & m_grid.GridBoundColumns(cc.ColIndex - 1).HeaderText Dim tb As GridTextBoxControl = CType(cc.Renderer.Control, GridTextBoxControl) tb.SelectAll() e.Handled = True End Sub

Administrator [Syncfusion]
Replied On May 21, 2005 12:10 AM UTC

Probably what is happening is that the text is selected immediately in your code, an dthen this gets undone when the error message is displayed later. Something to try. Instead of setting cc.ErrorMessage = "Invalid value for " & m_grid.GridBoundColumns(cc.ColIndex - 1).HeaderText go ahead and do a MessageBox.Show to display the message in your ValiedateFailed handler, then do the code that selects the text.

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

;