【发布时间】:2012-11-24 07:33:03
【问题描述】:
我有一个 RadGridView,我想防止用户在 第五 列中写入除 'c' 或 'd' 之外的任何字符或数字或字母。 我尝试了下面的代码,但它没有工作......
private void radGridView1_KeyPress(object sender, KeyPressEventArgs e)
{
if (radGridView1.CurrentColumn.Index == 4)
{
if (e.KeyChar != 'c' || e.KeyChar != 'd' )
e.Handled = true;
}
}
【问题讨论】:
标签: c# .net winforms telerik keypress