本文整理汇总了C#中System.Windows.Forms.DataGridViewRowCancelEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# DataGridViewRowCancelEventArgs类的具体用法?C# DataGridViewRowCancelEventArgs怎么用?C# DataGridViewRowCancelEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataGridViewRowCancelEventArgs类属于System.Windows.Forms命名空间,在下文中一共展示了DataGridViewRowCancelEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: dgvRoom_UserDeletingRow
private void dgvRoom_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
{
int id = 0;
if (int.TryParse(e.Row.Cells[0].Value.ToString(), out id))
{
IEnumerable<int> roomQuery = (from rQ in new LINQDataContext().Classroom_Times
where rQ.Room_ID == id
select rQ.Class_ID);
var aryRQ = roomQuery.ToArray();
if (aryRQ.Length>0)
{
string class_ID_List = "";
foreach (var anyClass in aryRQ)
{
class_ID_List += anyClass.ToString() + " and ";
}
class_ID_List = class_ID_List.Substring(0, class_ID_List.Length - 5);
e.Cancel = true;
MessageBox.Show("Information Classes with class numbers " +
class_ID_List + "is related to Room " +
e.Row.Cells[1].Value.ToString() +
".\n First, this information can change classes.", "Delete Row Error",
MessageBoxButtons.OK, MessageBoxIcon.Stop, MessageBoxDefaultButton.Button1);
}
else
{
new LINQDataContext().RoomDelete(id);
}
}
}
开发者ID:Behzadkhosravifar,项目名称:MakeClassSchedule,代码行数:32,代码来源:RoomForm.cs
示例2: DGProduct_UserDeletingRow
private void DGProduct_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
{
if (countDeleting == 1)
{
dialogResult = MessageBox.Show("Esta seguro que desea eliminar los productos seleccionados?\r\n" + DGProduct.SelectedRows.Count + " productos seran eliminados!", "Eliminar productos", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
countSelectedRows = DGProduct.SelectedRows.Count;
}
if (countDeleting == countSelectedRows)
{
countDeleting = 1;
countSelectedRows = 0;
}
else
countDeleting++;
if (dialogResult == DialogResult.Cancel)
e.Cancel = true;
else
{
try {
int id = Int32.Parse(e.Row.Cells["Id"].Value.ToString());
Product prod = stock.Product.First(i => i.id == id);
prod.deleted_at = DateTime.Now;
stock.SaveChanges();
}catch(Exception exc)
{
Console.WriteLine(exc);
}
finally {
e.Cancel = false;
}
}
}
开发者ID:tinchotricolor22,项目名称:Control-de-Stock,代码行数:35,代码来源:FormProduct.cs
示例3: GVMake_UserDeletingRow
private void GVMake_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
{
if (MessageBox.Show(Classes.Messages.MSG_RequestDel, Classes.Messages.TTLDefault, MessageBoxButtons.YesNo) == DialogResult.Yes)
{
control.DeleteRow(Convert.ToInt32(e.Row.Cells["cmid"].Value));
GVMake.DataSource = control.GetMakeType();
}
}
开发者ID:coderogue,项目名称:TaxiManagement,代码行数:8,代码来源:CarBuildView.cs
示例4: dataGridViewX1_UserDeletingRow
private void dataGridViewX1_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
{
if (MsgBox.Show("確定要刪除這筆資料?", "注意!", MessageBoxButtons.YesNo, MessageBoxIcon.Information) != System.Windows.Forms.DialogResult.Yes)
return;
SHDepartmentRecord dept = (SHDepartmentRecord)e.Row.Tag ;
if (dept != null)
this.deletedDepts.Add (dept);
}
开发者ID:jungfengpaulwang,项目名称:EMBACore,代码行数:9,代码来源:LearningGroup.cs
示例5: itemsDataGridView_UserDeletingRow
private void itemsDataGridView_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
{
if (MessageBox.Show("Do you want to delete SKU \"" + e.Row.Cells[1].Value + "\"?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2) ==
DialogResult.Yes) {
//TODO: Add Erase code
e.Cancel = true;
}
e.Cancel = true;
}
开发者ID:NasuTek,项目名称:NasuTek-Inventory-Services,代码行数:10,代码来源:Inventory.cs
示例6: Borrar
private void Borrar(object sender, DataGridViewRowCancelEventArgs e)
{
string valorIdentity = e.Row.Cells[0].Value.ToString();
string id_Transaccion = e.Row.Cells[1].Value.ToString();
b.EndEdit();
if (valorIdentity != "")
{
d.BorrarInversion(valorIdentity, id_Transaccion);
}
}
开发者ID:marianoir,项目名称:CuentaCorriente,代码行数:10,代码来源:Inversion.cs
示例7: dgCourses_UserDeletingRow
private void dgCourses_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
{
if (!e.Row.IsNewRow)
{
if ((MessageBox.Show("All assignments and associated grades for this course will be lost.", "Are you sure you want to delete this course?", MessageBoxButtons.OKCancel) == DialogResult.Cancel))
{
e.Cancel = true;
}
}
}
开发者ID:akauffmanGG,项目名称:Gradebook,代码行数:10,代码来源:MainForm.cs
示例8: AssignmentGrid_UserDeletingRow
private void AssignmentGrid_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
{
if (!e.Row.IsNewRow)
{
if ((MessageBox.Show("All student grades for this assignment will be lost.", "Are you sure you want to delete this assignment?", MessageBoxButtons.OKCancel) == DialogResult.Cancel))
{
e.Cancel = true;
}
}
}
开发者ID:akauffmanGG,项目名称:Gradebook,代码行数:10,代码来源:AssignmentGrid.cs
示例9: Borrar
private void Borrar(object sender, DataGridViewRowCancelEventArgs e)
{
string valorIdentity = e.Row.Cells[0].Value.ToString();
string id_Transaccion = "0";
b.EndEdit();
if (valorIdentity != "")
{
d.BorrarEmpresa(valorIdentity, id_Transaccion);
RefrescarProveedor();
}
}
开发者ID:marianoir,项目名称:CuentaCorriente,代码行数:11,代码来源:MaestroEmpresas.cs
示例10: dgUSSUsers_UserDeletingRow
private void dgUSSUsers_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
{
if (MessageBox.Show("Are you sure?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
DLL.SmartQuery.NonQuery("DELETE FROM dtsAuthorizedUsers WHERE Username = '" + e.Row.Cells["Username"].Value.ToString() + "'", true);
}
else
{
GetUsers();
}
}
开发者ID:ucfcba,项目名称:uss_manager,代码行数:11,代码来源:Manage_USSTracker_Users.cs
示例11: dgData_UserDeletingRow
private void dgData_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
{
if (MessageBox.Show("Are you sure?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
DLL.SmartQuery.NonQuery("DELETE FROM ussDateExceptions WHERE ExceptionID = '" + e.Row.Cells["ExceptionID"].Value.ToString() + "'");
}
else
{
GetData();
}
}
开发者ID:ucfcba,项目名称:uss_manager,代码行数:11,代码来源:Manage_COBA_DateExceptions.cs
示例12: delete_row
private void delete_row(object sender, DataGridViewRowCancelEventArgs e)
{
int Index = (Int32)dataGridView1.CurrentRow.Cells[0].Value;
DialogResult del = MetroFramework.MetroMessageBox.Show(this, "Delete App?",
"Add app to device", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
if(del == DialogResult.Yes)
{
dba.delete_software(u_id, Index);
load_table();
}
}
开发者ID:mattmarillac,项目名称:pear-app-store,代码行数:11,代码来源:dev_portal.cs
示例13: dgvAssessments_UserDeletingRow
private void dgvAssessments_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
{
DataGridViewRow row = e.Row;
if (!Database.DeleteAssessment((int)row.Cells[0].Value))
{
MessageBox.Show("Error: that assessment must have been taken.");
e.Cancel = true;
}
else
{
dgvAssessments.Refresh();
}
}
开发者ID:nicmoon,项目名称:cs361-GroupProject,代码行数:13,代码来源:AssessmentView.cs
示例14: dictionaryDataGrid_UserDeletingRow
private void dictionaryDataGrid_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
{
if (MessageBox.Show("Are you sure you want to delete to selected row?", "Delete Row?", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
//Todo delete the row and update the DataSet + DataGrid
LanguageData dataLayer = new LanguageData();
int i = dataLayer.daDictionary.DeleteByID((int)e.Row.Cells[0].Value);
if (i > 0)
{
if (DataChanged != null)
DataChanged(this, new EventArgs());
}
}
else
{
e.Cancel = true;
}
}
开发者ID:eneifert,项目名称:LanguageLearner,代码行数:19,代码来源:AddEditDictionary.cs
示例15: dataGridView1_UserDeletingRow
private void dataGridView1_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
{
/*if ((e.RowIndex < 0) || (dataGridView1.Rows.Count == 0))
return;
e.*/
/*String IDs = "(";
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
if (src.Contains(dataGridView1.Rows[i + 1]))
{
IDs += dataGridView1.Rows[i].Cells[0].Value.ToString();
if (i + 1 != dataGridView1.Rows.Count)
IDs += ", ";
}
if (i + 1 == dataGridView1.Rows.Count)
IDs += ")";}*/
if (e.Row.Cells[0].Value.ToString().Equals("-"))
{
MessageBox.Show("Это изделие сейчас выставлено на аукцион. Его нельзя удалить до завершения торгов.");
} else
try
{
String sacrifice = e.Row.Cells[0].Value.ToString();
sda1.DeleteCommand = new SqlCommand("DELETE FROM Изделие WHERE ID_Изделия=" + sacrifice, sc1);
sc1.Open();
sda1.DeleteCommand.ExecuteNonQuery();
sc1.Close();
}
catch (Exception exc)
{
MessageBox.Show("Ошибка: " + exc, "Alarm!");
//Console.WriteLine(exc);
}
finally
{
sc1.Close();
}
}
开发者ID:naXa777,项目名称:auction_db,代码行数:42,代码来源:FormGoods.cs
示例16: RemoveGridRow
public static bool RemoveGridRow(DataGridView view, DataGridViewRowCancelEventArgs e)
{
string tableName = Library.Util.GetTableName(view);
if (MessageBox.Show("你真的要删除么?", "确认删除",
MessageBoxButtons.YesNo) == DialogResult.No)
{
e.Cancel = true;
}
else
{
int id = (int)e.Row.Cells[0].Value;
string sql = "delete from [" + tableName + "] where id = @id";
SqlCommand cmd = new SqlCommand(sql, Library.Connection.Instance());
cmd.Parameters.AddWithValue("@id", id);
if (cmd.ExecuteNonQuery() > 0)
return true;
else
e.Cancel = true;
}
return false;
}
开发者ID:tjdbcourse,项目名称:tjdbcourse,代码行数:21,代码来源:Util.cs
示例17: systemsDataGridView_UserDeletingRow
private void systemsDataGridView_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
{
if (MessageBox.Show("Do you want to delete System with Serial Number \"" + e.Row.Cells[3].Value + "\"?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2) ==
DialogResult.Yes)
{
var serial = (string)e.Row.Cells[3].Value;
systemsTableAdapter.DeleteBySystemSerial(serial);
var unitParts = new SystemsInventoryDataSetTableAdapters.UnitPartsTableAdapter();
var movementRecords = new SystemsInventoryDataSetTableAdapters.MovementRecordsTableAdapter();
var itemPurchaseOrders = new SystemsInventoryDataSetTableAdapters.ItemPurchaseOrdersTableAdapter();
unitParts.DeleteBySystemSerial(serial);
movementRecords.DeleteBySystemSerial(serial);
itemPurchaseOrders.DeleteBySystemSerial(serial);
return;
}
e.Cancel = true;
}
开发者ID:NasuTek,项目名称:NasuTek-Inventory-Services,代码行数:21,代码来源:ListInventory.cs
示例18: dgvGroup_UserDeletingRow
private void dgvGroup_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
{
int id = 0;
if (int.TryParse(e.Row.Cells[0].Value.ToString(), out id))
{
var db = new LINQDataContext();
// Define the query expression.
var cquery = (from classs in db.Group_ID_Lists
where classs.Group_ID == id
select classs).ToArray();
if (cquery != null)
{
string query = @"DELETE From dbo.Group_ID_List Where Group_ID = {0}";
db.ExecuteQuery<object>(query, id);
}
else
{
db.New_GroupsPerClassDeleteByGroupID(id);
db.GroupsDelete(id);
}
db.Dispose();
}
}
开发者ID:Behzadkhosravifar,项目名称:MakeClassSchedule,代码行数:23,代码来源:GroupsForm.cs
示例19: uMLStepFlowCollectionDataGridView_UserDeletingRow
private void uMLStepFlowCollectionDataGridView_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
{
UMLStepFlow item = e.Row.DataBoundItem as UMLStepFlow;
//if (item != null)
//{
//UMLStepFlow item = uMLStepFlowCollectionBindingSource.Current as UMLStepFlow;
if (item != null)
{
DialogResult result = MessageBox.Show(this, "Are you sure?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
switch (result)
{
case DialogResult.Yes:
item.Delete();
//uMLStepFlowCollectionBindingSource.RemoveCurrent();
break;
default:
e.Cancel = true;
break;
}
}
//}
}
开发者ID:emanuelshv,项目名称:tupux,代码行数:24,代码来源:FlowEdit.cs
示例20: dgrWorkstation_UserDeletingRow
private void dgrWorkstation_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
{
DataGridViewRow balanRow = dgrWorkstation.Rows[0];
// Check if the Starting Balance row is included in the selected rows
if (dgrWorkstation.SelectedRows.Contains(balanRow))
{
// Do not allow the user to delete the Starting Balance row.
if (e.Row.Equals(balanRow))
{
// Cancel the deletion if the Starting Balance row is included.
e.Cancel = true;
}
else
{
DataGridViewRow row = e.Row;
}
}
}
开发者ID:huutruongqnvn,项目名称:vnecoo01,代码行数:20,代码来源:FrmWorkstation.cs
注:本文中的System.Windows.Forms.DataGridViewRowCancelEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论