当前位置: 首页>>代码示例>>C#>>正文


C# Controls.DataGridCellEditEndingEventArgs类代码示例

本文整理汇总了C#中System.Windows.Controls.DataGridCellEditEndingEventArgs的典型用法代码示例。如果您正苦于以下问题:C# DataGridCellEditEndingEventArgs类的具体用法?C# DataGridCellEditEndingEventArgs怎么用?C# DataGridCellEditEndingEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DataGridCellEditEndingEventArgs类属于System.Windows.Controls命名空间,在下文中一共展示了DataGridCellEditEndingEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetCurrentRow

        private List<object> GetCurrentRow(DataGridCellEditEndingEventArgs e)
        {
            List<object> values = new List<object>();
            foreach (object item in (MainDataGrid.SelectedItem as DataRowView).Row.ItemArray)
            {
                values.Add(item);
            }

            string name = e.Column.Header.ToString();
            string value = (e.EditingElement as TextBox).Text;

            for (int i = 0; i < MainDataGrid.Columns.Count; i++)
            {
                if (MainDataGrid.Columns[i].Header.ToString() == name)
                {
                    values[i] = value;
                    break;
                }
            }
            return values;
        }
开发者ID:vit2005,项目名称:Multitier-Project,代码行数:21,代码来源:MainWindow.xaml.cs

示例2: DataGrid_CellEditEnding

 private void DataGrid_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
 {
     if (e.EditingElement is TextBox)
     {
         ((TextBox)e.EditingElement).Text = ((TextBox)e.EditingElement).Text.Replace("\b", "");
     }
 }
开发者ID:hpbaotho,项目名称:sambapos,代码行数:7,代码来源:MenuItemPropertyGroupView.xaml.cs

示例3: productSaleOrderGrid_CellEditEnding

 private void productSaleOrderGrid_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
 {
     DataGrid grid = (DataGrid)sender;
     Popup productSelector = (Popup)grid.FindName("productSelector");
     productSelector.IsOpen = false;
     
 }
开发者ID:bdlions,项目名称:InventoryMS,代码行数:7,代码来源:SalesOrderInfo.xaml.cs

示例4: SubjectTeacher_DG_CellEditEnding

 private void SubjectTeacher_DG_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
 {
     if (e.Column is DataGridTemplateColumn)
     {
         BindingOperations.ClearAllBindings(e.EditingElement as ContentPresenter);
     }
 }
开发者ID:GrayJumba,项目名称:Onion,代码行数:7,代码来源:SubjectTeachers.xaml.cs

示例5: OnCellEditEnding

 protected override void OnCellEditEnding(DataGridCellEditEndingEventArgs e)
 {
     continueEdit = e.EditAction == DataGridEditAction.Commit;
     Log.DebugFormat("OnCellEditEnding(EditAction = {0})", e.EditAction);
     Log.DebugFormat("    continueEdit={0}, isNewItem={1}", continueEdit, isNewItemForContinueEdit);
     base.OnCellEditEnding(e);
 }
开发者ID:daszat,项目名称:zetbox,代码行数:7,代码来源:ZetboxDataGrid.cs

示例6: dgEmp_CellEditEnding

        /// <summary>
        /// Read Data entered in each Cell
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dgEmp_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
        {
            try
            {
                    FrameworkElement eleEno = dgEmp.Columns[0].GetCellContent(e.Row);
                    if (eleEno.GetType() == typeof(TextBox))
                    {
                        emp.EmpNo = Convert.ToInt32(((TextBox)eleEno).Text);
                    }

                    FrameworkElement eleEname = dgEmp.Columns[1].GetCellContent(e.Row);
                    if (eleEname.GetType() == typeof(TextBox))
                    {
                        emp.EmpName = ((TextBox)eleEname).Text;
                    }

                    FrameworkElement eleSal = dgEmp.Columns[2].GetCellContent(e.Row);
                    if (eleSal.GetType() == typeof(TextBox))
                    {
                        emp.Salary = Convert.ToInt32(((TextBox)eleSal).Text);
                    }

                    FrameworkElement eleDname = dgEmp.Columns[3].GetCellContent(e.Row);
                    if (eleDname.GetType() == typeof(TextBox))
                    {
                        emp.DeptName = ((TextBox)eleDname).Text;
                    }

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
开发者ID:sammy1188,项目名称:WPF_Excel-Sam,代码行数:39,代码来源:MainWindow.xaml.cs

示例7: dataGrid_CellEditEnding

 private void dataGrid_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
 {
     if (count != standard.Subjects.Count)
     {
         count = standard.Subjects.Count;
         Analyse();
     }
 }
开发者ID:aarsee,项目名称:Marksheet-Application,代码行数:8,代码来源:PageMarks.xaml.cs

示例8: check_showDataGrid_CellEditEnding

        private void check_showDataGrid_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
        {





        }
开发者ID:cloudtimesoft,项目名称:Fixed_management,代码行数:8,代码来源:Check.xaml.cs

示例9: ColumnListBox_CellEditEnding

 private void ColumnListBox_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
 {
     if (e.Column.Header as String == "EnumName")
     {
         var tx = e.EditingElement as TextBox;
         this.SetEnumNameToStoredProcedure(tx.Text);
     }
 }
开发者ID:fengweijp,项目名称:higlabo,代码行数:8,代码来源:MainWindow.xaml.cs

示例10: dg_CellEditEnding

 void dg_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
 {
     var fff= e.Column.GetCellContent(e.Row);
     if (fff != null && fff.BindingGroup != null && fff.BindingGroup.Items.Count > 0)
     {
         bool flag= fff.BindingGroup.CommitEdit();
         Console.WriteLine(flag);
     }
 }
开发者ID:Deson621,项目名称:demo,代码行数:9,代码来源:MainWindow.xaml.cs

示例11: GridOnCellEditEnding

        private void GridOnCellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
        {
            if (_displayIndexCommiting)
                return;

            if (!ReferenceEquals(e.Column, ColumnDisplayIndex))
                return;

            if (e.EditAction != DataGridEditAction.Commit)
                return;

            _displayIndexCommiting = true;
            bool commited = Grid.CommitEdit(DataGridEditingUnit.Row, true);
            _displayIndexCommiting = false;

            if (!commited)
                return;

            var editedItem = (GridColumnSettings)e.Row.Item;
            _newDisplayIndex = editedItem.DisplayIndex;

            if (_newDisplayIndex < 0)
            {
                _newDisplayIndex = 0;
                editedItem.DisplayIndex = _newDisplayIndex;
            }
            else if (_newDisplayIndex >= Grid.Items.Count)
            {
                _newDisplayIndex = Grid.Items.Count - 1;
                editedItem.DisplayIndex = _newDisplayIndex;
            }

            if (_oldDisplayIndex < _newDisplayIndex)
            {
                foreach (GridColumnSettings item in Grid.Items)
                {
                    if (ReferenceEquals(item, editedItem))
                        continue;

                    if (item.DisplayIndex >= _oldDisplayIndex + 1 && item.DisplayIndex <= _newDisplayIndex)
                        item.DisplayIndex -= 1;
                }
            }
            else
            {
                foreach (GridColumnSettings item in Grid.Items)
                {
                    if (ReferenceEquals(item, editedItem))
                        continue;

                    if (item.DisplayIndex >= _newDisplayIndex && item.DisplayIndex <= _oldDisplayIndex - 1)
                        item.DisplayIndex += 1;
                }
            }

            Grid.UpdateTarget(ItemsControl.ItemsSourceProperty);
        }
开发者ID:ashwinsathyar,项目名称:BuildVision,代码行数:57,代码来源:GridSettingsControl.xaml.cs

示例12: employeeDataGrid_CellEditEnding

 private void employeeDataGrid_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
 {
     var employee = e.Row.Item as Employee;
     if (employee != null)
     {
         switch (e.Column.Header.ToString())
         {
             case "First Name":
                 {
                     var textBox = e.EditingElement as TextBox;
                     employee.FirstName = textBox.Text;
                     break;
                 }
             case "Last Name":
                 {
                     var textBox = e.EditingElement as TextBox;
                     employee.LastName = textBox.Text;
                     break;
                 }
             case "Email":
                 {
                     var textBox = e.EditingElement as TextBox;
                     if (Regex.IsMatch(textBox.Text,
                             @"^(?("")("".+?(?<!\\)""@)|(([0-9a-z]((\.(?!\.))|[-!#\$%&'\*\+/=\?\^`\{\}\|~\w])*)(?<=[0-9a-z])@))" +
                             @"(?(\[)(\[(\d{1,3}\.){3}\d{1,3}\])|(([0-9a-z][-\w]*[0-9a-z]*\.)+[a-z0-9][\-a-z0-9]{0,22}[a-z0-9]))$",
                             RegexOptions.IgnoreCase))
                     {
                         employee.Email = textBox.Text;
                     }
                     else
                     {
                         MessageBox.Show("Invalid email fromat!");
                         textBox.Text = employee.Email;
                     }
                     break;
                 }
             case "Birth Date":
                 {
                     var datePicker = VisualTreeHelper.GetChild(e.EditingElement, 0) as DatePicker;
                     if (datePicker.SelectedDate < DateTime.Now
                         && datePicker.SelectedDate != null)
                     {
                         employee.BirthDate = (DateTime)datePicker.SelectedDate;
                     }
                     else
                     {
                         MessageBox.Show("Invalid date provided!");
                         datePicker.SelectedDate = employee.BirthDate;
                     }
                     break;
                 }
             default:
                 break;
         }
     }
 }
开发者ID:abdonkov,项目名称:HackBulgaria-CSharp,代码行数:56,代码来源:MainWindow.xaml.cs

示例13: StreamDG_CellEditEnding

        private void StreamDG_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
        {
            DataRowView rowView = e.Row.Item as DataRowView;
            rowBeingEdited = rowView;

            if (e.Column is DataGridTemplateColumn)
            {
                BindingOperations.ClearAllBindings(e.EditingElement as ContentPresenter);
            }
        }
开发者ID:GrayJumba,项目名称:Onion,代码行数:10,代码来源:Class.xaml.cs

示例14: LinkDataGrid_CellEditEnding

        private void LinkDataGrid_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
        {
            var textBox = (TextBox)e.EditingElement;
            var composition = (Composition)DataContext;

            var url = textBox.Text;
            var link = (Link)textBox.DataContext;
            link.Compositions.Add(composition);
            link.Name = UrlToTitleConverter.UrlToTitle(url);
        }
开发者ID:nharren,项目名称:MusicTimeline,代码行数:10,代码来源:CompositionEditPage.xaml.cs

示例15: dgSpares_CellEditEnding

 private void dgSpares_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
 {
     HandleMainDataGridCellEditEnding(sender, e);
     SpareView sv = (SpareView)e.Row.DataContext;
     if (sv.id > 0)
         if (sv.q_demand.HasValue)
         {
             sv.demand = (int)sv.q_demand - (int)sv.QRest;
             if (sv.demand < 0)
                 sv.demand = 0;
         }
 }
开发者ID:bashlykevich,项目名称:Bycar,代码行数:12,代码来源:RequestEditView.xaml.cs


注:本文中的System.Windows.Controls.DataGridCellEditEndingEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。