本文整理汇总了C#中System.Windows.Controls.DataGridCellEditEndingEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# DataGridCellEditEndingEventArgs类的具体用法?C# DataGridCellEditEndingEventArgs怎么用?C# DataGridCellEditEndingEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataGridCellEditEndingEventArgs类属于System.Windows.Controls命名空间,在下文中一共展示了DataGridCellEditEndingEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: PPTableJobListDataGrid_CellEditEnding
/// <summary>
/// Update the description in database
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void PPTableJobListDataGrid_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
{
try
{
if (e.EditAction == DataGridEditAction.Commit && e.Column is DataGridTextColumn)
{
var item = e.Row.Item as JobListItemVm;
var val = (e.EditingElement as TextBox).Text;
item.UpdateDescription(val);
}
}
catch { }
}
开发者ID:T1Easyware,项目名称:Soheil,代码行数:18,代码来源:JobList.xaml.cs
示例17: GroupList_CellEditEnding
private void GroupList_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
{
var info = GroupList.SelectedItem as Group.Info;
if (e.Column.Header.ToString() == "좌표") {
var txt = e.EditingElement as TextBox;
if (txt.Text != "") {
info.coordinate = Point.Parse(txt.Text);
}
}
if (addedList.Contains(info) == false && changedList.Contains(info) == false) {
changedList.Add(info);
}
}
开发者ID:erynet,项目名称:IMS,代码行数:15,代码来源:GroupManagePage.xaml.cs
示例18: DG_ASN_GR_CellEditEnding
private void DG_ASN_GR_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
{
string GRLineNo = "";
var i = DG_ASN_GR.SelectedItem;
var b = i as DataRowView;
if (b != null)
{
GRLineNo = b.Row[0].ToString(); //取得GR表中主键
}
//单元格动态取值
/*var cell = DG_ASN_GR.CurrentCell;
DataRowView item = cell.Item as DataRowView;
if (item != null)
{
item[cell.Column.DisplayIndex].ToString();
}*/
next_cell_value= (e.Column.GetCellContent(e.Row) as TextBox).Text;
if (pre_cell_value != next_cell_value)
{
//判断是否是product单元格更改,column index应该是2;
if (DG_ASN_GR.CurrentColumn.DisplayIndex == 2)
{
if(Global.VerifyProductCode(next_cell_value,Global.strCustomerCode) != null)
{
//如果匹配
bool result=ASNDAL.UpdateASNGR(GRLineNo, "product_code",next_cell_value);
MessageBox.Show(result.ToString());
}
else
{
//如果更改后产品代码不存在数据库中
MessageBox.Show(Global.strCustomerName+"中"+next_cell_value+"不存在。请注意输入正确的产品代码。");
//还原更改前的数值
(e.Column.GetCellContent(e.Row) as TextBox).Text = pre_cell_value;
}
}
}
}
开发者ID:FSeanXiao,项目名称:WpfSkyline,代码行数:48,代码来源:ASN_GR.xaml.cs
示例19: dgWorkers_CellEditEnding_1
private void dgWorkers_CellEditEnding_1(object sender, DataGridCellEditEndingEventArgs e)
{
Action action = delegate
{
int index = dgWorkers.Items.IndexOf(dgWorkers.CurrentItem);
Worker wkr = e.Row.Item as Worker;
bool updateRes = _repo.Update(wkr);
if (updateRes)
{
MessageBox.Show(wkr.ToString() + "\r\r was update" , "Update");
}
};
Dispatcher.BeginInvoke(action, System.Windows.Threading.DispatcherPriority.Background);
}
开发者ID:RoykoSerhiy,项目名称:visualStudio_projects,代码行数:17,代码来源:MainWindow.xaml.cs
示例20: dataGrid_CellEditEnding
private void dataGrid_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
{
if (((dataGrid.SelectedItem as Variable).Value != int.Parse((e.EditingElement as TextBox).Text)) && MessageBox.Show(App.Current.TryFindResource("delconfirmation").ToString() + "",
App.Current.TryFindResource("save").ToString(), MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
{
try
{
int value = int.Parse((e.EditingElement as TextBox).Text);
SQLiteHelper.GetSqlHelper.UpdateVariable((dataGrid.SelectedItem as Variable).Name, value);
}
catch
{
MessageBox.Show(App.Current.TryFindResource("valueint").ToString());
}
}
SetVariables();
}
开发者ID:RoboLOGO,项目名称:IDE,代码行数:18,代码来源:Method.xaml.cs
注:本文中的System.Windows.Controls.DataGridCellEditEndingEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论