Exemple #1
0
        // ---------------------- //
        // -- Data Management --- //
        // ---------------------- //

        // Data updates //

        // Data retrieval //

        // Other/shared functions //
        private void refreshClientGrid()
        {
            try
            {
                gridList = ClientFunctions.ClientGridList(activeOnly, nameContains, accountManagerID, Globals.CurrentEntityID);
                ClientDataGrid.ItemsSource = gridList;
                if (selectedRecord != null || Globals.SelectedClient != null)
                {
                    try
                    {
                        int selectedID = (selectedRecord != null) ? selectedRecord.ID : Globals.SelectedClient.ID;
                        if (gridList.Exists(c => c.ID == selectedID))
                        {
                            ClientDataGrid.SelectedItem = gridList.First(c => c.ID == selectedID);
                            ClientDataGrid.ScrollIntoView(ClientDataGrid.SelectedItem);
                        }
                        else
                        {
                            Globals.SelectedClient = null;
                        }
                    }
                    catch (Exception generalException) { MessageFunctions.Error("Error selecting the current row", generalException); }
                }
            }
            catch (Exception generalException) { MessageFunctions.Error("Error refreshing client details in the grid", generalException); }
        }