ComponentOne True DBGrid for .NET (2.0) Search HelpCentral 

C1DisplayColumn.AllowFocus Property

Gets or sets a value indicating the ability of a column to receive focus.

[Visual Basic]

Public Property AllowFocus As Boolean

[C#]

public bool AllowFocus {get;set;}

[Delphi]

public property AllowFocus: Boolean read get_AllowFocus write set_AllowFocus;

Remarks

If True (the default), the user will be able to interactively select the object, giving it focus.

If False, the user will not be able to interactively select the object. When clicked, the object will not receive focus and the control (or grid column) that previously had focus will retain it.

For C1DisplayColumn objects, setting AllowFocus to True enables cells within the object to receive focus. If set to False, there is no way to change the focus to a cell within the object. However, if an object already has the focus, setting AllowFocus to False will not give focus to another split, column, or control.

If a cell in a column which does not allow focus is clicked, and the cell is in a row other than the current row, then the row is changed, but the column with the focus retains it.

Example

The following code uses the AllowFocus property to prevent the first column from getting focus:

·      Visual Basic

       Me.C1TrueDBGrid1.Splits(0).DisplayColumns(0).AllowFocus = False

·      C#

       this.c1TrueDBGrid1.Splits[0].DisplayColumns[0].AllowFocus = false;

·      Delphi

       Self.C1TrueDBGrid1.Splits[0].DisplayColumns[0].AllowFocus := False;

See Also

C1DisplayColumn Class | C1DisplayColumn Members | C1.Win.C1TrueDBGrid Namespace


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.