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!

How To Limit String Entry Size In A GridView Field/Cell

Status
Not open for further replies.

Skittle

ISP
Sep 10, 2002
1,528
US
I have a Visual Studio 2010 ASp.Net page with a gridview control.
The gridview control is bound to a Object Data Source.

My problem is that a user can type to many chacters into a gridview cell for a string
and hit 'update'. I want to prevent a user from typing in more than the maximum number of
characters for the text field. I expected to see a maximum length property associated with
the column within the 'Edit Columns' option of the gridview but there isn't one.

What is the recommended approach to limiting a string size in a gridview bound to an Object data Source?


Dazed and confused.

Remember.. 'Depression is just anger without enthusiasum'.
 
Found out how to do it.
Very easy.
Simply convert the field/cell to a template field an then the template field maximum length can be set.

Hey its....my first ASp.NEt application and I'm learning as I go.
:eek:)


Dazed and confused.

Remember.. 'Depression is just anger without enthusiasum'.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top