The easiest way to create modern business applications for the Cloud and Office 365
We just released a couple more “How Do I” videos on the LightSwitch Developer Center:
#19 - How Do I: Set Default Values on Fields when Entering New Data? #20 - How Do I: Copy Data from One Row into a New Row?
In these videos I show you how to write a bit of code to set values on fields in a couple different ways in order to make it faster for users to enter data.
And don’t forget you can watch all the How Do I videos here: LightSwitch “How Do I” Videos on MSDN
Enjoy, -Beth Massi, Visual Studio Community
A more practical How Do I, would be to Copy the Currently selected Row:
Private Sub OrderDetails_Changed(e As System.Collections.Specialized.NotifyCollectionChangedEventArgs)
If e.Action = Collections.Specialized.NotifyCollectionChangedAction.Add Then
' Clone Selected Order Details
If e.NewItems.Count = 1 AndAlso Me.OrderDetails.SelectedItem IsNot Nothing Then
Dim newDetail As OrderDetail = e.NewItems(0)
newDetail.Quantity = Me.OrderDetails.SelectedItem.Quantity
newDetail.Price = Me.OrderDetails.SelectedItem.Price