Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting column restrictions in a dataset

Status
Not open for further replies.

goneWildCoder

Programmer
May 26, 2004
20
US
Hi all,

I have a dataset and I want to ensure that the user enters 2 characters for the first column. How do I do this?

I used MaxLength -->
dataSet11.Division.Div_CodeColumn.MaxLength = 2;

but this allows input of characters at most 2 characters in length ie it allows input that is less than 2 characters in length. How do i disallow this ?
 
you should add a code snippet that verifies the minimum length of the text when the user changes the current cell (CurrentCellChanged) or when the datagrid looses focus(Leave). if the text is less than two characters popup an error message and set the datagrid's current cell property to the cell that is not ok.

if you still need help, post back.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top