如何限制DataGridView中某列只能输入汉字?同时可以限定字数?
解决方案 »
- 请教下自动更新问题 exe,dll文件报错404 文本和rar没问题
- 无法直接启动带有”类库输出的类型“的项目
- 如何分解这些字符串!
- WinForm File.Copy File.Delete 问题
- 如果计算N个Unicode格式的字符如果要存到byte[]里需要占多大空间?
- 放100分,请从Delphi开发转到C#开发的老Delphi程序员来谈谈自己的感受。
- wpf相关问题
- ····很急的问题:command.Parameters.Add( parameter );里的add方法既不是私有方法,也不是静态方法。为什么就在remoting 里调用不了
- 在 WinFrm 中怎样把 DataGrid 中显示的最后的空白行去掉呢。
- C#中的Web用户控件的使用问题?
- 《Essential C#3.0》中的一处疑似错误,请高手给我确认一下
- web.conf自定义节处理
this.txtGrvText.onchange=function(){
var regex=@"^[\u4e00-\u9fa5]{0,n}$";
if(regex.text(this.value))
{
alert('请输入汉字');
return;
}
};
{
e.Cancel = false;
}
{
dataGridView1.Rows[e.RowIndex].ErrorText = string.Empty;
if(dataGridView1.Columns[e.ColumnIndex].DataPropertyName == "")
{
if(Regex.IsMatch(e.FormattedValue.ToString(), @"^[\u4e00-\u9fa5]+$") )
{
e.Cancel = true;
}
}
}