zoukankan      html  css  js  c++  java
  • DataGridView使用大全(二)

    开发者经常会利用datagridview做添加,修改,删除操作,有时还要同步更新到数据库,有时需要修改整行,有时需要修改整列,有时修改多行,多列。

    现在先写个修改某一列的选中行的内容,借此抛砖引玉

    int Count=this.DataGridView1.SelectedCells.Count;

     DateTime dtStartTime123 = Convert.ToDateTime(this.dataGridView1.SelectedCells[0].OwningRow.Cells[1].Value.ToString());
              startTime123 = dtStartTime123.ToString("yyyyMMddHHmm");
              DateTime dtEndTime123 = Convert.ToDateTime(this.dataGridView1.SelectedCells[this.dataGridView1.SelectedCells.Count - 1].OwningRow.Cells[1].Value.ToString());
              endTime123 = dtEndTime123.ToString("yyyyMMddHHmm");
              columnName = this.dataGridView1.SelectedCells[0].OwningColumn.DataPropertyName.ToString();

  • 相关阅读:
    next_permutation( ) 和prev_permutation( ) 全排列函数
    F
    STL入门
    H
    C
    提交按钮组件
    JScorllPane面板(带滚轮的JPane)
    JPanel画板
    网络布局管理器
    边界布局管理器
  • 原文地址:https://www.cnblogs.com/qiyecao/p/2790194.html
Copyright © 2011-2022 走看看