Gets the focus settings of the Grid such as the focus mode, color, painting mode, etc...

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

Syntax

C#
public Grid..::..GridFocus FocusSettings { get; }
Visual Basic
Public ReadOnly Property FocusSettings As Grid..::..GridFocus
	Get
Visual C++
public:
property Grid..::..GridFocus^ FocusSettings {
	Grid..::..GridFocus^ get ();
}
F#
member FocusSettings : Grid..::..GridFocus with get

Property Value

Type: Grid..::..GridFocus
The focus settings.

Examples

 Copy imageCopy
public void FocusExample(Grid grid)
{
    //Set a new color with the alpha channel for the focused row.
    grid.FocusSettings.Color = Color.FromArgb(30, 128, 0, 30);

    grid.FocusedRowChanged += delegate(object sender, FocusedRowEventArgs e)
    {
        Console.WriteLine("Previous focused row: {0}", e.PrevFocusedRow != null ? e.PrevFocusedRow.VisibleIndex.ToString() : "not specified");
        Console.WriteLine("New focused row: {0}", e.NewFocusedRow != null ? e.NewFocusedRow.VisibleIndex.ToString() : "not specified");
    };

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

    //Set the row focused
    grid.Rows[1].Focused = true;

    Console.WriteLine("Focused row visible index: {0}", grid.FocusedRow.VisibleIndex);

    //Clear the focus
    grid.FocusedRow = null;
    //Another way to clear focus:
    grid.FocusSettings.Clear();
}

//Console output:
Previous focused row: not specified
New focused row: 1
Focused row visible index: 1
Previous focused row: 1
New focused row: not specified

See Also