Private Sub ContctDomainDataSource_LoadedData(ByVal sender As System.Object, ByVal e As System.Windows.Controls.LoadedDataEventArgs) Handles ContctDomainDataSource.LoadedData ActivityDisplay.IsActive = False Dim _lst As List(Of Contct)() ContctDataGrid.ItemsSource = _lst Dim iRowCount As Integer = _lst.Count() CountBox1.Text = _lst.Count If e.HasError Then System.Windows.MessageBox.Show(e.Error.ToString, "Load Error", System.Windows.MessageBoxButton.OK) e.MarkErrorAsHandled() End If End Sub
Dim loadCustomer As EntityQuery(Of Customer_Profile2) = Domaincontext.GetCustomerProfileQuery() loadCustomer.IncludeTotalCount = True Dim loadOp = Domaincontext.Load(Of Customer_Profile2)(loadCustomer).TotalEntityCount
<pre lang="vb">If (DataGrid.ItemsSource IsNot Nothing) Then Dim count As Integer = DataGrid.ItemsSource.OfType(Of Object)().Count() lblCount_Gen.Content = "Count: " & count End If
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)