数据网格视图单元格格式和导航 [英] Data grid view cell Formatting and Navigation

查看:66
本文介绍了数据网格视图单元格格式和导航的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
在数据网格视图中

1.我正在尝试在A,B,C等单元格中填充值...即一次仅一个Alphabate.

2.当我们按回车键时,焦点将移至下一行.我试图将其移至同一行的下一个单元格,而不是下一行.


Hello,
In Data Grid View

1.I am trying to fill values in cell like A,B,C etc...ie. only one Capital Alphabate at a time.

2.When we press enter the focus moves to next row..i am trying to move it on next cell of same row instead of next row.


How to Do this both of two ???

推荐答案

您好,Yatin,

对于2:


Hi Yatin,

for 2 :


private void DataGridView1_KeyDown(object sender, KeyEventArgs e)
{
     if (e.KeyCode == Keys.Enter)
     {
          dataGridView1.CurrentCell = dataGridView1.Rows[dataGridView1.CurrentRow.Index + 1].Cells[0];
     }
}


希望对您有所帮助.
:)


I hope this help.
:)


这篇关于数据网格视图单元格格式和导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆