Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have one datagrid and i am entering values in run time . i need to validate my cell named as quantity, in which i want to enter only numbers. in which event i have to write the coding for this? am using VS 2008 windows application with c#. Can anyone one help me to solve this?
Posted

Simple Google search is enough for this

Enter Only Number In DataGridView[^]
About datagridview control's event[^]
DataGridView KeyDown?[^]

Have a great weekend
:java:
 
Share this answer
 
Comments
Aswathi Narayan 26-Jul-11 0:54am    
Thank u very much
thatraja 26-Jul-11 10:29am    
You welcome, BTW Clicked the wrong vote button.
So you need to identify the event you want to work with, probably celledit or cellleave
Create an method to consume the event.
In the method you need to identify the cell you want to work with, check out the event arguments (e)
Do what you need to do when you identify the cell needed.

Try inspecting the control you are working with, get to know the main events and properties, these wll allow you to manipulate the control effectively.
 
Share this answer
 
Comments
Aswathi Narayan 24-Jul-11 6:58am    
My problem is if am entering any alphabets in cell named Quantity in datagridview it wont come there.Only the numbers must be displayed. am new to windows application. in web application i used filtered textbox ajax extender.. Can u help me

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