Contains information about updated IDataField

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

Syntax

C#
public sealed class FieldChangedEventArgs : EventArgs
Visual Basic
Public NotInheritable Class FieldChangedEventArgs
	Inherits EventArgs
Visual C++
public ref class FieldChangedEventArgs sealed : public EventArgs
F#
[<SealedAttribute>]
type FieldChangedEventArgs =  
    class
        inherit EventArgs
    end

Remarks

A part of event-driven model. This agrument tells Grid which field is changed:
 Copy imageCopy
//Some data object
public class Product : INotifyPropertyChanged
{
    //Some fields
    private double price;
    private DateTime maturity;

    [DoubleFormat(Precision = 3, ShortForm = true, ShowZero = false)]
    public double Price
    {
        get { return price; }
        set 
        {
            price = value;
            if(PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs("Price"));
            }
        }
    }

    public DateTime Maturity
    {
        get { return maturity; }
    }

    public event PropertyChangedEventHandler PropertyChanged;
}

//Using sample
public void AddDataObjectToGrid(Grid grid)
{
    //Initialize the grid
    grid.Headers.Add(new Header());
    grid.Headers[0].Add(new Column("Price"));
    grid.Headers[0].Add(new Column("Maturity"));


    //Add data object to the grid. The object will be implicitly wrapped by the DataObjectAccessor class
    grid.Rows.Add(new Product());

    //Add data object to the grid and wrap it explicitly by the DataObjectAccessor class 
    //(You can provide your custom implementation of the data accessor). 
    grid.Rows.Add(new DataObjectAccessor(new Product()));

    //Build some hierarchy...
    grid.Rows[0].Add(new Product());

    //Or from another thread - this is safe.
    ThreadPool.QueueUserWorkItem(delegate
    {
        grid.Rows[0].Add(new Product());
    });
}

Inheritance Hierarchy

System..::..Object
  System..::..EventArgs
    Dapfor.Net.Data..::..FieldChangedEventArgs

See Also