1
我有一个RadGridView,我想阻止用户在第五列列中写入'c'或'd'以外的任何字符或数字或字母。 我曾尝试下面的代码,但它没有工作...只允许特定的字母在RadGridView中的特定列
private void radGridView1_KeyPress(object sender, KeyPressEventArgs e)
{
if (radGridView1.CurrentColumn.Index == 4)
{
if (e.KeyChar != 'c' || e.KeyChar != 'd')
e.Handled = true;
}
}
感谢很多:) – fadd
@fadddd如果它的工作,可以接受通过单击复选标记的答案,让未来的用户知道它的工作对你旁边的答案:) – KreepN