I have 2 related tables:
Contracts and ContractStatus
I have a screen with a datagrid allowing me to search the contracts entity for expired contracts based on a date range.
Using Yann's solution for enabling multiple row selection (https://code.msdn.microsoft.com/How-To-Enable-Multiple-Row-0ca9662c#content) I am then trying to create a button that will update the ContractStatus field of the selected contract rows to "Chargeable"
but am having trouble finding the right expression. I can update other fields using this method fine, just not the ContractStatus field.
This is what I have so far:
Private Sub UpdateToChargeable_Execute()
'if the variable hasn't been set, just leave, there's nothing more we can do here
If (_itemsControl Is Nothing) Then Return
Dim count As Integer
count = 0
'loop through the selected rows
For Each row As Contract In _itemsControl.SelectedItems
row.ContractStatus =
count = count + 1
Next
End Sub
After row.ContractStatus = it won't accept an integer (the id) or a string (the description). The error i get is "Value of type 'String' cannot be converted to 'LightswitchApplication.ContractStatus'.
Any ideas on what I am doing wrong?
Many thanks