• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Forms.DataGridViewCellEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: dataGridView1_CellContentClick

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            SqlConnection con = new SqlConnection(constring);
            con.Open();

            int curRow = int.Parse(e.RowIndex.ToString());
            string currentrow;
            currentrow = dataGridView1.Rows[curRow].Cells[1].Value.ToString();

            SqlDataAdapter adp1 = new SqlDataAdapter("Select * from ResManagerToAdmin where ResID='" + currentrow + "'", con);
            DataSet ds1 = new DataSet();
            adp1.Fill(ds1);

            SqlCommand cmd = new SqlCommand("Update ResManagerToAdmin set RView='" + p2 + "' where ResID='" + currentrow + "'", con);
            cmd.ExecuteNonQuery();

            SqlCommand cmd1 = new SqlCommand("Update ResManagerToAdmin set RFinalView='" + p2 + "' where ResID='" + currentrow + "'", con);
            cmd1.ExecuteNonQuery();

            status = ds1.Tables[0].Rows[0]["RStatus"].ToString();

            if (status == "Success")
            {
                ViewAdminResponses var = new ViewAdminResponses();
                var.ShowDialog();
            }
            else
            {
                RecordNotFound rnf = new RecordNotFound();
                rnf.ShowDialog();
            }
        }
开发者ID:balajivit1,项目名称:Sourcecode,代码行数:32,代码来源:User.cs


示例2: dataGridView1_CellDoubleClick

 private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     History.pid = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
     History.pname = dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString();
     History h = new History();
     h.ShowDialog();
 }
开发者ID:evilnapsis,项目名称:inventio-win,代码行数:7,代码来源:Inventory.cs


示例3: dataGridViewCrs_CellClick

 private void dataGridViewCrs_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     int cnt = 0;
     oracleConnection1.Open();
     chartCntStd.Series[0].Points.Clear();
     dataGridViewResult.Rows.Clear();
     string mySQL = "SELECT CRS_NUM, CRS_YEAR, CRS_TERM, COUNT(EN_STD_NUM) AS CNT_STD "
         + "FROM PRO1_COURSES LEFT OUTER JOIN PRO1_ENROLLS ON CRS_YEAR = EN_CRS_YEAR AND CRS_TERM = EN_CRS_TERM AND CRS_NUM = EN_CRS_NUM "
         + "GROUP BY CRS_NUM, CRS_YEAR, CRS_TERM";
     oracleCommand1.CommandText = mySQL + " HAVING CRS_NUM IN " + "'" + dataGridViewCrs.CurrentRow.Cells[0].Value.ToString() + "'";
     OracleDataReader rdr1 = oracleCommand1.ExecuteReader();
     while (rdr1.Read())
     {
         dataGridViewResult.Rows.Add();
         dataGridViewResult.Rows[cnt].Cells[0].Value = rdr1["CRS_YEAR"];
         dataGridViewResult.Rows[cnt].Cells[1].Value = rdr1["CRS_TERM"];
         dataGridViewResult.Rows[cnt].Cells[2].Value = rdr1["CNT_STD"];
         chartCntStd.Series[0].Points.AddXY(rdr1["CRS_YEAR"], rdr1["CNT_STD"]);
         cnt++;
     }
     if (!avgFlag)
     {
         oracleCommand2.CommandText = "SELECT CRS_YEAR, CRS_TERM, ROUND(AVG(CNT_STD),0) AS AVG_STD " +
             "FROM (" + mySQL + ") GROUP BY CRS_YEAR, CRS_TERM";
         OracleDataReader rdr2 = oracleCommand2.ExecuteReader();
         while (rdr2.Read())
         {
             chartCntStd.Series[1].Points.AddXY(rdr2["CRS_YEAR"], Convert.ToInt32(rdr2["AVG_STD"]));
         }
         avgFlag = true;
         rdr2.Close();
     }
     rdr1.Close();
     oracleConnection1.Close();
 }
开发者ID:Torhemp,项目名称:University,代码行数:35,代码来源:CntStd.cs


示例4: dgvCalendar_CellEnter

        private void dgvCalendar_CellEnter(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                DataGridView dgv = (DataGridView)sender;

                bool state = !dgv.CurrentRow.IsNewRow ? true : false;

                switch (lang)
                {
                    case "calendarfa":
                        tmiCalendarEdit.Enabled = state;
                        tmiCalendarErase.Enabled = state;
                        break;
                    case "calendaren":
                        tmiCalendarEditEn.Enabled = state;
                        tmiCalendarEraseEn.Enabled = state;
                        break;
                    case "calendarar":
                        tmiCalendarEditAr.Enabled = state;
                        tmiCalendarEraseAr.Enabled = state;
                        break;
                    default:
                        break;
                }

                miCalendarEdit.Enabled = state;
                miCalendarErase.Enabled = state;
            }
            catch
            {
            }
        }
开发者ID:Siadatian,项目名称:kermanshahchhto.ir,代码行数:33,代码来源:Calendar.cs


示例5: dgvTSRecord_CellClick

        private void dgvTSRecord_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (timeSheetFSWorkingDaysBindingSource.Current == null)
            {
                return;
            }

            if (dgvTSRecord.Columns[e.ColumnIndex].DataPropertyName == "IsClosed")
            {
                if (!(timeSheetFSWorkingDaysBindingSource.Current as TimeSheetRecord).IsCreated)
                {
                    MessageBox.Show("Выбранная запись еще не добавлена в табель!");
                    return;
                }

                if ((timeSheetFSWorkingDaysBindingSource.Current as TimeSheetRecord).TimeSheetFSRecord.TimeSheet.IsClosed == true)
                {
                    MessageBox.Show("Табель рабочего времени закрыт для редактирования!");
                    return;
                }

                //зафиксировано - устанавливаем
                if ((timeSheetFSWorkingDaysBindingSource.Current != null) &&
                    ((timeSheetFSWorkingDaysBindingSource.Current as TimeSheetRecord).IsCreated))
                {
                    (timeSheetFSWorkingDaysBindingSource.Current as TimeSheetRecord).TimeSheetFSRecord.IsClosed =
                        !(timeSheetFSWorkingDaysBindingSource.Current as TimeSheetRecord).TimeSheetFSRecord.IsClosed;
                    KadrController.Instance.Model.SubmitChanges();
                }
            }
        }
开发者ID:UGTU,项目名称:UGTUKadrProject,代码行数:31,代码来源:TimeSheetReport.cs


示例6: jokasoDaichoListDataGridView_CellDoubleClick

        private void jokasoDaichoListDataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            string hokenjoCd, torokuNengetsu, renban;

            TraceLog.StartWrite(MethodInfo.GetCurrentMethod());
            Cursor preCursor = Cursor.Current;

            try
            {
                Cursor.Current = Cursors.WaitCursor;

                if (e.RowIndex > -1)
                {
                    hokenjoCd = jokasoDaichoListDataGridView.Rows[e.RowIndex].Cells[0].Value.ToString();
                    torokuNengetsu = jokasoDaichoListDataGridView.Rows[e.RowIndex].Cells[1].Value.ToString();
                    renban = jokasoDaichoListDataGridView.Rows[e.RowIndex].Cells[2].Value.ToString();

                    JokasoDaichoShosai frm = new JokasoDaichoShosai(hokenjoCd, torokuNengetsu, renban);
                    Program.mForm.ShowForm(frm);
                }
            }
            catch (Exception ex)
            {
                TraceLog.ErrorWrite(MethodInfo.GetCurrentMethod(), ex.ToString());
                MessageForm.Show(MessageForm.DispModeType.Error, MessageResouce.MSGID_E00001, ex.Message);
            }
            finally
            {
                Cursor.Current = preCursor;
                TraceLog.EndWrite(MethodInfo.GetCurrentMethod());
            }
        }
开发者ID:25cm,项目名称:HelloWorld,代码行数:32,代码来源:JokasoDaichoList.cs


示例7: dataGridViewCSharp_CellEnter

        private void dataGridViewCSharp_CellEnter(object sender, DataGridViewCellEventArgs e)
        {
            DotNetType dotnetType = (DotNetType)((DataGridView)sender).Rows[e.RowIndex].Tag;

            if (dotnetType == null)
            {
                labelUsedBy.Text = "";
                return;
            }
            labelUsedBy.BeginUpdate();

            StringBuilder sb = new StringBuilder();
            sb.AppendLine("<br/><br/>");
            //sb.AppendFormat("<br/>{0}UniType: <b>{1}</b>", SPACE, dotnetType.Name);
            //sb.AppendFormat("<br/>{0}C# type: <b>{1}</b>", SPACE, dotnetType.CSharpType);
            //sb.AppendLine("<br/><br/>");
            sb.AppendFormat("<br/>{0}<b>DB types that map to this:</b><br/><br/>", SPACE);

            sb.Append(GetDisplayTextForTypeUsages("SQL Server Types", Utility.SqlServerTypes, dotnetType));
            sb.Append(GetDisplayTextForTypeUsages("Oracle Types", Utility.OracleTypes, dotnetType));
            sb.Append(GetDisplayTextForTypeUsages("MySQL Types", Utility.MySqlTypes, dotnetType));
            sb.Append(GetDisplayTextForTypeUsages("PostgreSQL Types", Utility.PostgreSqlTypes, dotnetType));
            sb.Append(GetDisplayTextForTypeUsages("Firebird Types", Utility.FirebirdTypes, dotnetType));
            sb.Append(GetDisplayTextForTypeUsages("SQLite Types", Utility.SQLiteTypes, dotnetType));
            labelUsedBy.Text = sb.ToString();
            labelUsedBy.EndUpdate();
        }
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:27,代码来源:BaseTypeMapEditor.cs


示例8: OnGridWasClicked

        private void OnGridWasClicked(object sender, DataGridViewCellEventArgs e)
        {
            var grid = sender as DataGridView;

            if(null == grid)
                return;

            int rowIndex = e.RowIndex;

            if(rowIndex< 0)
                return;

            var row = grid.Rows[rowIndex];

            int w = (int) row.Tag;
            var limitation = grid.Tag as WeightLimitation;
            if(null == limitation)
                return;

            if(limitation.ContainsWeight(w))
            {
                limitation.Remove(w);
            }
            else
            {
                limitation.Add(w);
            }

            PaintRow(grid, rowIndex);

            _fullSystem.NeedsToBeCounted = true;
            _fullSystem.NeedsToBeSaved = true;
        }
开发者ID:jpazarzis,项目名称:hogar,代码行数:33,代码来源:WeightStatisticsForm.cs


示例9: dataGridViewDTE_CellDoubleClick

        private void dataGridViewDTE_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            _pin.command(String.Format("{0}", dataGridViewDTE[0, e.RowIndex].Value));

            dataGridViewDTE.Rows[e.RowIndex].DefaultCellStyle.SelectionBackColor = Color.FromArgb(245, 242, 203);
            dataGridViewDTE.Rows[e.RowIndex].DefaultCellStyle.SelectionForeColor = Color.FromArgb(23, 36, 47);
        }
开发者ID:3F,项目名称:vsCommandEvent,代码行数:7,代码来源:DTECommandsFrm.cs


示例10: dgvLoaithuoc_CellContentClick

 private void dgvLoaithuoc_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     txtMaLT.DataBindings.Clear();
     txtMaLT.DataBindings.Add("Text", dgvLoaithuoc.DataSource, "MaLoai");
     txtTenLT.DataBindings.Clear();
     txtTenLT.DataBindings.Add("Text", dgvLoaithuoc.DataSource, "Ten");
 }
开发者ID:thanphong,项目名称:hospitalmanager-project,代码行数:7,代码来源:LoaiThuoc.cs


示例11: dataGridView1_CellClick

 private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex == ColDelete.Index)
     {
         dataGridView1.Rows.RemoveAt(e.RowIndex);
     }
 }
开发者ID:gitter-badger,项目名称:DLaB.Xrm.XrmToolBoxTools,代码行数:7,代码来源:SpecifyAttributesDialog.cs


示例12: dgLedger_CellContentDoubleClick

 private void dgLedger_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     sResult = dgLedger.SelectedRows[0].Cells[0].Value.ToString();
     sDescription = dgLedger.SelectedRows[0].Cells[1].Value.ToString();
     this.DialogResult = DialogResult.OK;
     this.Close();
 }
开发者ID:anthonied,项目名称:LiquidPastel,代码行数:7,代码来源:LedgerZoom.cs


示例13: dataGridView1_CellContentClick

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.RowIndex >= 0)
                {
                    DataGridViewRow row = this.dataGridView1.Rows[e.RowIndex];
                    string serialNo = row.Cells["S.No"].Value.ToString();
                    DBManager manager=new DBManager();
                    SqlConnection connection = manager.Connection();
                    string query = "delete from Books Where [S.No]='" + serialNo + "'";
                    SqlCommand delCommand=new SqlCommand(query,connection);
                    connection.Open();

                    System.Windows.Forms.DialogResult result =
                        MessageBox.Show("Do you wnat to delete the selected book?", "Message", MessageBoxButtons.YesNo,
                            MessageBoxIcon.Question);
                    if (result == DialogResult.Yes)
                    {
                        delCommand.ExecuteNonQuery();
                        MessageBox.Show("deleted", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        TestBook(); 
                    }


 
                }
            }
            catch (Exception exception)
            {

                MessageBox.Show(exception.StackTrace);
            }
        }
开发者ID:salamcseiu21,项目名称:Library-Management-With-CSharp-Desktop-,代码行数:34,代码来源:UpdateUI.cs


示例14: dataGridViewNCC_CellClick

 private void dataGridViewNCC_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0)
     {
         DataGridViewRow row = this.dataGridViewNCC.Rows[e.RowIndex];
         txtTenNCC.Text = row.Cells[0].Value.ToString();
     }
     DAL.DALNhaCungCap.layNCCtheoten(txtTenNCC.Text);
     BUSNhaCungCap bNCC = new BUSNhaCungCap();
     var NCC = bNCC.layNCCtheoten(txtTenNCC.Text);
     if (NCC == null)
     {
         MessageBox.Show("Không tồn tại nhà cung cấp");
     }
     else
     {
         txtDiaChi.Text = NCC.DiaChi;
         txtEmail.Text = NCC.Email;
         txtSoDT.Text = NCC.SoDienThoai;
         txtTaiKhoan.Text = NCC.IDTaiKhoan;
         txtChuTK.Text = NCC.TenChuTK;
         dateTimePicker1.Text = Convert.ToString(NCC.NgayMoTK);
         txtChitietkhac.Text = NCC.ChiTietKhac;
     }
 }
开发者ID:noface151,项目名称:Project,代码行数:25,代码来源:FrmNhaCungCap.cs


示例15: dataGridView1_CellDoubleClick

        private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            Grados.Text = dataGridView1.CurrentRow.Cells[0].Value.ToString();
            gradoMod = Grados.Text;

            try
            {

                if (con.State != ConnectionState.Open)
                    con.Open();
                SqlCommand cmd2 = new SqlCommand();
                cmd2.Connection = con;
                cmd2.CommandType = System.Data.CommandType.Text;
                cmd2.CommandText = "select ID_GRADO, ID_IND, ID, NOMBRE, VALOR from GRADOS where ID=" + id_eva + " and NOMBRE='" + dataGridView1.CurrentRow.Cells[0].Value.ToString() + "' group by ID_GRADO, ID_IND, ID, NOMBRE, VALOR ORDER BY ID_GRADO;";
                SqlDataAdapter da = new SqlDataAdapter(cmd2);
                DataTable dt = new DataTable();
                DataSet ds = new DataSet();
                da.Fill(ds);
                dt = ds.Tables[0];
                dataGridView2.DataSource = dt;
            }
            catch (Exception ene)
            {
                MessageBox.Show(ene.ToString());
            }
            finally
            {
                if (con.State != ConnectionState.Closed)
                    con.Close();

            }
        }
开发者ID:josselynmedina,项目名称:SED,代码行数:32,代码来源:EditarGrados.cs


示例16: dataGridView1_CellContentClick

 private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     _form1.viaje = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[1].Value.ToString();
     _form1.butaca = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[2].Value.ToString();
     _form1.kg = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[3].Value.ToString();
     this.Hide();
 }
开发者ID:fedegonzalez,项目名称:tp-gdd-assassins,代码行数:7,代码来源:listadoViajes.cs


示例17: grid_CellClick

 private void grid_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex == 4)
     {
         var id = int.Parse(grid.Rows[e.RowIndex].Cells[0].Value.ToString());
         var lname = grid.Rows[e.RowIndex].Cells[1].Value.ToString();
         var fname = grid.Rows[e.RowIndex].Cells[2].Value.ToString();
         var age = int.Parse(grid.Rows[e.RowIndex].Cells[3].Value.ToString());
         var p = new Person(id, lname, fname, age);
         var formEdit = new fEdit();
         formEdit.P = p;
         formEdit.pd = pd;
         formEdit.mv = this;
         formEdit.ShowDialog();
     }
     else
     {
         if (e.ColumnIndex == 5)
         {
             var id = int.Parse(grid.Rows[e.RowIndex].Cells[0].Value.ToString());
             var lname = grid.Rows[e.RowIndex].Cells[1].Value.ToString();
             var fname = grid.Rows[e.RowIndex].Cells[2].Value.ToString();
             var age = int.Parse(grid.Rows[e.RowIndex].Cells[3].Value.ToString());
             var p = new Person(id, lname, fname, age);
             var formDelete = new fDelete();
             formDelete.P = p;
             formDelete.pd = pd;
             formDelete.mv = this;
             formDelete.ShowDialog();
         }
     }
     ShowData(pd.Read());
 }
开发者ID:overload17,项目名称:Database,代码行数:33,代码来源:fMain.cs


示例18: grid_reply_CellContentClick

 private void grid_reply_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex == 0)
     {
         grb_mess.Text = grid_reply.CurrentRow.Cells[2].Value.ToString();
         txt_sub.Text = grid_reply.CurrentRow.Cells[3].Value.ToString();
         txt_content.Text = grid_reply.CurrentRow.Cells[1].Value.ToString();
         if (Convert.ToBoolean(grid_reply.CurrentRow.Cells[5].Value) == false)
         {
             txt_reply.Text = "Chưa có trả lời";
         }
         else
         {
             //lbl_reply.Text = "Trả lời: " + grid_reply.CurrentRow.Cells[4].Value.ToString();
             txt_reply.Text = grid_reply.CurrentRow.Cells[4].Value.ToString();
         }
         /*MaMH = grib_All_Subject.CurrentRow.Cells[1].Value.ToString();
         TenMH = grib_All_Subject.CurrentRow.Cells[2].Value.ToString();
         Hocky = grib_All_Subject.CurrentRow.Cells[3].Value.ToString();
         try
         {
             frmDS = new GV_DanhSachLopMH(MaGV, MaMH, TenMH, Hocky);
             frmDS.Show();
         }
         catch (Exception)
         {
             MessageBox.Show("Service not response", "Error");
         }*/
     }
 }
开发者ID:windynguyen,项目名称:GroupOneProject,代码行数:30,代码来源:PhanHoi.cs


示例19: dgvReserva_CellClick

 private void dgvReserva_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dgvReserva.CurrentCell.ColumnIndex==0)
     {
         dgvReserva.ClearSelection();
     }
 }
开发者ID:martinc2015,项目名称:KRISMAGIT,代码行数:7,代码来源:RegistrarReserva.cs


示例20: gridTeam2_CellContentClick

 private void gridTeam2_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (gridTeam2.CurrentCell.ColumnIndex == 1)
     {
         Process.Start("http://www.coh2.org/ladders/playercard/steamid/" + gridTeam2.CurrentRow.Cells[3].Value);
     }
 }
开发者ID:ryantaylor,项目名称:CoH2ReplayTools,代码行数:7,代码来源:mainForm.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Forms.DataGridViewCellFormattingEventArgs类代码示例发布时间:2022-05-26
下一篇:
C# Forms.DataGridViewCellCancelEventArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap