GridControl's focus settings.

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

Syntax

C#
[TypeConverterAttribute(typeof(ExpandableObjectConverter))]
public class GridControlFocusSettings : INotifyPropertyChanged, 
	ICloneable
Visual Basic
<TypeConverterAttribute(GetType(ExpandableObjectConverter))>
Public Class GridControlFocusSettings
	Implements INotifyPropertyChanged, ICloneable
Visual C++
[TypeConverterAttribute(typeof(ExpandableObjectConverter))]
public ref class GridControlFocusSettings : INotifyPropertyChanged, 
	ICloneable
F#
[<TypeConverterAttribute(typeof(ExpandableObjectConverter))>]
type GridControlFocusSettings =  
    class
        interface INotifyPropertyChanged
        interface ICloneable
    end

Remarks

 Copy imageCopy
public void FocusExample(GridControl grid)
{
    //Set a new color with the alpha channel for the focused row.
    grid.AppearanceFocusBackground = new SolidColorBrush(Color.FromArgb(30, 128, 0, 30));
    grid.AppearanceFocusBorder = new SolidColorBrush(Color.FromArgb(80, 128, 0, 30));
    grid.AppearanceFocusBorderThickness = new Thickness(0.4);

    grid.FocusedRowChanged += delegate(object sender, GridControlFocusedRowEventArgs 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;
}

//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

Inheritance Hierarchy

System..::..Object
  Dapfor.Wpf.Controls..::..GridControlFocusSettings

See Also