Gets or sets a value indicating whether this Column is focused.

Namespace: Dapfor.Wpf.Controls
Assembly: Dapfor.Wpf (in Dapfor.Wpf.dll) Version: 4.1.0.26317 (4.1.0.26317)

Syntax

C#
public bool Focused { get; set; }
Visual Basic
Public Property Focused As Boolean
	Get
	Set
Visual C++
public:
property bool Focused {
	bool get ();
	void set (bool value);
}
F#
member Focused : bool with get, set

Property Value

Type: Boolean
true if focused; otherwise, false.

Remarks

 Copy imageCopy
public void FocusedCellExample(GridControl grid)
{
    //Add a new header on the top hierarchical level (level 0)
    Header header = new Header();
    header.Add(new Column("Name"));
    header.Add(new Column("Price"));
    header.Add(new Column("Quantity"));
    grid.Headers.Add(header);

    //Set the focus mode
    grid.SettingsFocus.Mode = FocusMode.Cell;

    //Add some data objects 
    grid.Rows.Add(new Product());
    grid.Rows.Add(new Product());

    //Focus the cell
    grid.Rows[0]["Price"].Focused = true;

    Console.WriteLine("Focused row = {0}", grid.FocusedRow.VisibleChildIndex);
    Console.WriteLine("Focused column = {0}", grid.Headers[0].FocusedColumn.Id);

    //Focus other column
    grid.Headers[0]["Quantity"].Focused = true;

    Console.WriteLine("The cell[0, 'Quantity'] is {0}", grid.Rows[0]["Quantity"].Focused ? "focused" : "not focused");
}

//Console output:
Focused row = 0
Focused column = Price
The cell[0, 'Quantity'] is focused

See Also