Okay, I've got a datagridview in my WinForms app that auto-builds the column list from a datatable schema. It's working fine, except that it allows the user to enter values too long for the database field. For example, I have a "name" field that is defined in the Sql-Server database as a varchar(50). Is there any way to limit that cell (column?) so that it only accepts 50 characters? Right now it lets them enter anything and throws an exception later.

I know this can be done with a textbox, merely by setting the MaxLength property... but I'm not seeing anything that lets me do the same thing with the control in a datagridview column.

Any help is appreciated.