博客
关于我
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/

    你可能感兴趣的文章
    Node提示:npm does not support Node.js v12.16.3
    查看>>
    Node搭建静态资源服务器时后缀名与响应头映射关系的Json文件
    查看>>
    Node服务在断开SSH后停止运行解决方案(创建守护进程)
    查看>>
    node模块化
    查看>>
    node模块的本质
    查看>>
    node环境下使用import引入外部文件出错
    查看>>
    node环境:Error listen EADDRINUSE :::3000
    查看>>
    Node的Web应用框架Express的简介与搭建HelloWorld
    查看>>
    Node第一天
    查看>>
    node编译程序内存溢出
    查看>>
    Node读取并输出txt文件内容
    查看>>
    node防xss攻击插件
    查看>>
    noi 1996 登山
    查看>>
    noi 7827 质数的和与积
    查看>>
    NOI-1.3-11-计算浮点数相除的余数
    查看>>
    NOI2010 海拔(平面图最大流)
    查看>>
    NOIp2005 过河
    查看>>
    NOIP2011T1 数字反转
    查看>>
    NOIP2014 提高组 Day2——寻找道路
    查看>>
    noip借教室 题解
    查看>>