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.
Syncfusion Feedback

Focus is not changed from an Enabled cell.

Thread ID:

Created:

Updated:

Platform:

Replies:

1664 Nov 18,2002 08:41 PM UTC Nov 19,2002 02:50 PM UTC Windows Forms 2
loading
Tags: GridControl
Tom Le Blanc
Asked On November 18, 2002 08:41 PM UTC

I have a column that has been disabled with: grid1.Model.ColStyles(1).Enabled = False If a user selects one of the enabled cells to edit information then clicks on one of the cells in the disabled column that cell then appears to be selected (but readonly) but the enabled cell remains in focus with the caret active in the cell awaiting orders. Is this by design? Is there someway to remove focus from the enabled cell eventhough the newly selected cell is diabled? Thanks, Tom

Administrator [Syncfusion]
Replied On November 19, 2002 12:08 AM UTC

> I have a column that has been disabled with: > grid1.Model.ColStyles(1).Enabled = False > > If a user selects one of the enabled cells to edit information then clicks on one of the cells in the disabled column that cell then appears to be selected (but readonly) but the enabled cell remains in focus with the caret active in the cell awaiting orders. > > Is this by design? Is there someway to remove focus from the enabled cell eventhough the newly selected cell is diabled? > > Thanks, > Tom > This behavior is by design. If you click on some disabled control, the current focus does not change. The grid mimics this behavior. If you want to stop the editing when you click a disabled cell, then you could try handling the click event, and calling CurrentCell.EndEditing. Private Sub GridDataBoundGrid1_CellClick(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridCellClickEventArgs) Handles GridDataBoundGrid1.CellClick Console.WriteLine("GridDataBoundGrid1_CellClick") If Me.GridDataBoundGrid1(e.RowIndex, e.ColIndex).Enabled = False Then Me.GridDataBoundGrid1.CurrentCell.EndEdit() End If End Sub

Tom Le Blanc
Replied On November 19, 2002 02:50 PM UTC

Thanks Clay, That didn't quite work but it pointed me in the right direction. I added this after the EndEdit command: GridControl1.CurrentCell.Deactivate(False) The Deactivate method did the trick. It removed the focus from the editable cell. [The "False" retains edits the user made in the cell.] Tom

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

;