(sfDataGrid1.View as CollectionViewAdv).CollectionChanged += Form1_CollectionChanged;
private void Form1_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
if(e.Action==System.Collections.Specialized.NotifyCollectionChangedAction.Add)
{
OrderInfo newRecord = ((e.NewItems[0] as RecordEntry).Data as OrderInfo);
OrderInfo orderInfo = new OrderInfo();
orderInfo.OrderID = newRecord.OrderID;
orderInfo.ContactNumber = newRecord.ContactNumber;
orderInfo.CustomerID = newRecord.CustomerID;
orderInfo.OrderDate = newRecord.OrderDate;
orderInfo.ProductName = newRecord.ProductName;
orderInfo.Quantity = newRecord.Quantity;
orderInfo.ShipCountry = newRecord.ShipCountry;
orderInfo.UnitPrice = newRecord.UnitPrice;
}
} |