DataGridView单元格格式化,检索 [英] DataGridView Cell Formating, Retrieving

查看:81
本文介绍了DataGridView单元格格式化,检索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好.

我正在使用c#执行Windows桌面应用程序.

我有一个带有5列的DataGridView,即(MarkType,Mark1,Mark2,Mark3,Mark4),它允许用户为每个``MarkType''输入两个数字标记.

我需要格式化所有标记单元"的格式以仅允许两位数字且不允许字母字母.
我还需要在添加标记后立即检索这些标记,而不是在保存按钮上.

我尝试了

Hi there.

Im doing a Windows Desktop Application using c#.

I have a DataGridView with 5 columns namely(MarkType, Mark1, Mark2, Mark3, Mark4) and it allows a user to enter two digit marks per ''MarkType''.

I need to format All Mark Cells to only allow two digits and no alphabetical letters.
I also need to retrieve those marks directly after they''ve been added and not on a save button.

I tried

int mark1=Convert.ToInt32(this.datagridview.CurrentRow.Selected.ToString());

在CellLeave_Event上获得标记,但不起作用.

任何帮助都可以.

关于

to get the mark upon CellLeave_Event but doesn''t work.

Any Help would do.

Regards

推荐答案

您是否听说过: O0o


这篇关于DataGridView单元格格式化,检索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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