博客
关于我
datagridview 常用操作代码
阅读量:124 次
发布时间:2019-02-27

本文共 1263 字,大约阅读时间需要 4 分钟。

???????

DataGridView???C#?????????????????????????????????????????????DataGridView?????????????????????DataGridView?????????????

?????????

???DataGridView??????????????????????

  • ??????????

    ??????????DataGridView???????????

    string headText = this.dataGridView1.Columns[this.dataGridView1.CurrentCell.ColumnIndex].HeaderText;

    ???dataGridView1 ?DataGridView??????CurrentCell ?????????????

  • ??????????

    ???????????????????????????

    string name = this.dataGridView1.Columns[this.dataGridView1.CurrentCell.ColumnIndex].Name;
  • ???????

    ???????????DataGridView?????????????

    private void getCurrentCellButton_Click(object sender, System.EventArgs e){    string msg = String.Format("Row: {0}, Column: {1}",        dataGridView1.CurrentCell.RowIndex,        dataGridView1.CurrentCell.ColumnIndex);    MessageBox.Show(msg, "Current Cell");}

    ???????

    ?????????DataGridView??????????????????

    private void setCurrentCellButton_Click(object sender, System.EventArgs e){    // ?????????0??1?    this.dataGridView2.CurrentCell = this.dataGridView1[1, 0];}

    ??DataGridView?CurrentCell??

    DataGridView???CurrentCell ????????????????????????????

    this.dataGridView1.CurrentCell = this.dataGridView1[1, 0];

    ???dataGridView1 ?DataGridView??????1 ??????0 ???????????????????????????

    ??????????????

    转载地址:http://eerf.baihongyu.com/

    你可能感兴趣的文章
    pandas.DataFrame.copy(deep=True) 实际上并不创建深拷贝
    查看>>
    pandas.read_csv()的详解-ChatGPT4o作答
    查看>>
    PANDAS.READ_EXCEL()输出‘;溢出错误:日期值超出范围‘;而不存在日期列
    查看>>
    pandas100个骚操作:再见 for 循环!速度提升315倍!
    查看>>
    Pandas:如何根据其他列值的条件对列进行求和?
    查看>>
    Pandas:对给定列求和 DataFrame 行
    查看>>
    Pandas、groupby 和特定月份的求和
    查看>>
    Pandas、Matplotlib、Pyecharts数据分析实践
    查看>>
    Pandas中文官档 ~ 基础用法1
    查看>>
    Pandas中文官档~基础用法2
    查看>>
    SpringBoot+Vue+OpenOffice实现文档管理(文档上传、下载、在线预览)
    查看>>
    Pandas中文官档~基础用法5
    查看>>
    Pandas中文官档~基础用法6
    查看>>
    Pandas中的GROUP BY AND SUM不丢失列
    查看>>
    Pandas中的GROUP BY AND SUM不丢失列
    查看>>
    Pandas之iloc、loc
    查看>>
    pandas交换两列
    查看>>
    pandas介绍-ChatGPT4o作答
    查看>>
    pandas删除指定列里面内容的行
    查看>>
    pandas去除Nan值
    查看>>