I have a project using C# in Lightswitch 2012 that has the following tables:
Clients
- Id - Integer
- CaseID - Long Integer
- FullName - String
- Address - String
- Tracking - TrackingItem Collection
Staff
- Id - Integer
- PIN - Integer
- FullName - String
- Tracking - TrackingItem Collection
Tracking
- Id - Integer
- Client - Client
- Staff - StaffItem
- StartDate - Date
- StartTime - DateTime
- EndTime - DateTime
- Units - Double (calculated field)
- TogetherTime - Boolean
Relationships are as follows: Each tracking object must have at least one Client and at least one Staff, and each Client and Staff can have many Tracking objects. I currently have a query called TrackingFilter that lets users filter the Tracking table on a search screen called SearchTrackingFilter by client name, staff name, a date range, and whether or not the item is marked as together time. This also displays the calculated field "Units" in the results table. What I am trying to do is add a text field to the screen above the results table that shows the total number of units that the query returned with whatever criteria the user selected. I'm a bit stuck at this point and don't know what to do. I can add labels and such to the screen just fine, but I can't seem to edit any sort of code or anything that would let me add up the total number of units returned by the query. Any help would be appreciated.