//When the user selects a row in the datagrid void dgv_AgentBrokerSalesMan_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (agentbrokersalesman.ABSMSearchControl.ResultsGrid.SelectedItem != null) { EditingAgentBrokerSalesMan = (agentbrokersalesman.ABSMSearchControl.ResultsGrid.SelectedItem as ERP_AgentBrokerSalesMan).Clone() as ERP_AgentBrokerSalesMan; } }
//This is a event which fires whenever newitems arrive at the datagrid private void ItemSourceChanged(object sender, EventArgs e) { AgentBrokerSalesManInformation = agentbrokersalesman.ABSMSearchControl.ResultsGrid.ItemsSource as ObservableCollection <ERP_AgentBrokerSalesMan>; agentbrokersalesman.AgentBrokerSalesManGrid.DataContext = AgentBrokerSalesManInformation; if (AgentBrokerSalesManInformation.Count > 0) { EditingAgentBrokerSalesMan = AgentBrokerSalesManInformation[0].Clone(); } }