Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am developing my application with visual studio 2008 .Net 3.5 WindowsApllication where i am using property grid veiw.
I want to limit length of string when user write something on datafeild for example maxlength 100 user must not allowed to write more that 100
So i want to call KeyPress event in property grid which i didn#t find
How can i do so when user write something in Propertgrid datafeild, I used ProperyvalueChanged Event but it didnt work ??????????
Posted
Comments
Madhuri Gamane 12-Sep-14 5:42am    
Grid view don't have keypress event, you should call cellEndEdit event
BillWoodruff 12-Sep-14 9:30am    
Take the time to search CodeProject and review the articles here on PropertyGrid.

Use CellValidating to check if the length is longer then 100...if it is set e.Cancel = false so it doesn't propagate.

If everything is OK, use CellValidated event to save the value

If this helps, please take time to accept the solution so others may find it.
 
Share this answer
 
v2
Use
C#
validation property
or you can use
C#
jquery validation
to validate this type of work..
 
Share this answer
 
Iam talking about Propertygrid not Datagrid
how can i raise a cell validating event with property grid
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900