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


C# Forms.DataGridViewRowCancelEventArgs类代码示例

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


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


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