Occurs when a data object, inserted into the
Grid is updated.
Namespace: Dapfor.Net.UiAssembly: Dapfor.Net (in Dapfor.Net.dll) Version: 2.10.3.24917 (2.10.3.24917)
Syntax
C# |
---|
public event EventHandler<GridRowUpdateEventArgs> RowUpdated |
Visual Basic |
---|
Public Event RowUpdated As EventHandler(Of GridRowUpdateEventArgs) |
Visual C++ |
---|
public:
event EventHandler<GridRowUpdateEventArgs^>^ RowUpdated {
void add (EventHandler<GridRowUpdateEventArgs^>^ value);
void remove (EventHandler<GridRowUpdateEventArgs^>^ value);
} |
F# |
---|
member RowUpdated : IEvent<EventHandler<GridRowUpdateEventArgs>,
GridRowUpdateEventArgs>
|
Value
Type:
System..::..EventHandler<(Of <(<'GridRowUpdateEventArgs>)>)>Examples
| Copy |
---|
public class Product : INotifyPropertyChanged
{
private double price;
private DateTime maturity;
[DoubleFormat(Precision = 3, ShortForm = true, ShowZero = false)]
public double Price
{
get { return price; }
set
{
if (price != value)
{
price = value;
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs("Price"));
}
}
}
}
public DateTime Maturity
{
get { return maturity; }
}
public event PropertyChangedEventHandler PropertyChanged;
}
public void InitializeGrid(Grid grid)
{
grid.Headers.Add(new Header());
grid.Headers[0].Add(new Column("Price"));
grid.Headers[0].Add(new Column("Maturity"));
Console.WriteLine("Current thread: {0}", Thread.CurrentThread.ManagedThreadId);
grid.RowUpdated += delegate(object sender, GridRowUpdateEventArgs e)
{
int threadId = Thread.CurrentThread.ManagedThreadId;
Console.WriteLine("The data object has been updated. Row = {0}, Field = {1}, Value = {2}, Thread = {3}", e.Row.VisibleIndex, e.DataField.Id, e.DataField.Value, threadId);
};
Product product = new Product();
grid.Rows.Add(product);
product.Price = 12.34;
ThreadPool.QueueUserWorkItem(delegate
{
int threadId = Thread.CurrentThread.ManagedThreadId;
Console.WriteLine("Update data object from non-GUI thread (Thread = {0})", threadId);
product.Price = 25.66;
});
}
|
Thread Safety
The event
RowUpdated is raised only in the GUI thread even the data object had notified the
Grid from other thread.
See Also