Specifies focus mode

Namespace: Dapfor.Net.Ui
Assembly: Dapfor.Net (in Dapfor.Net.dll) Version: (


public enum FocusMode
Visual Basic
Public Enumeration FocusMode
Visual C++
public enum class FocusMode
type FocusMode


Member nameValueDescription
Row0 The Grid can focus a whole Row.
Cell1 The Grid can focus a Cell.


Following example demonstrates how to focus cells, rows and columns
 Copy imageCopy
public void FocusedCellExample(Grid 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"));

    //Set the focus mode
    grid.FocusSettings.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