I am developing a windows application in C#.Net 2005.
In this I have used one datagridview towhich I bound one datatable whichhas three columns.
In thisone column called as Emp Name is editable i.e. user can enter \ updateEmp name.
But I want to retrict Emp Name to 50 characters.
I want to set maxlength of that column at RUNTIME. I know there is property called MaxInputLength atdesigntime but I am not getting such property at runtime.
Datagrid name is dgrdChannel and that column No. is 2
I tried - dgrdChannel.Columns[2].MaxInputLength
But there is no such property.
So please give me code for this.
And also Only letters should be entered in that column and no numbers or special characters.
I know how to validate this as -
if (Char.IsLetter(e.KeyChar) == true )
But on which event I should write this, There is no event such as CellKeyPress.
How to do this?