예제 #1
0
        //*************************************************************
        private void dgEmp_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
        {
            if (isUpdateMode) //The Row is  edited
            {
                filtred TempEmp = (from emp in objContext.filtreds
                                   where emp.Id == objEmpToEdit.Id
                                   select emp).First();


                FrameworkElement element_1 = dgEmp.Columns[2].GetCellContent(e.Row);
                if (element_1.GetType() == typeof(TextBox))
                {
                    var FName = ((TextBox)element_1).Text;
                    objEmpToEdit.FileName = FName;
                }
                FrameworkElement element_2 = dgEmp.Columns[3].GetCellContent(e.Row);
                if (element_2.GetType() == typeof(TextBox))
                {
                    var FPath = ((TextBox)element_2).Text;
                    objEmpToEdit.FilePath = FPath;
                }
                FrameworkElement element_3 = dgEmp.Columns[4].GetCellContent(e.Row);
                if (element_3.GetType() == typeof(TextBox))
                {
                    var FVoice = ((TextBox)element_3).Text;
                    objEmpToEdit.FilePath = FVoice;
                }
            }
        }
예제 #2
0
 private void dgEmp_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     objEmpToEdit = dgEmp.SelectedItem as filtred;
 }