|
-
Jul 21st, 2011, 10:04 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] How to limit text entry in DataGridView
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.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|