Click here to Skip to main content
15,890,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a dataset which contains the following tables:

http://i.stack.imgur.com/fZisY.png

As you can see it's possible to edit it's values directly (and i prefer it that way), but sometimes i wanna limit its value, for example, if the user attempts to place a number 3, i want the program to display a message:

MessageBox.Show("This parameter can only use values between 0 and 1.";);
and then proceed to set the value to 1 (which is closest to 3)

is this possible? What is the action that makes the program recognize the value the user has just input?
Posted
Comments
[no name] 4-May-14 6:18am    
Try using the CellValidating or RowValidating events.

1 solution

You can try this:

1. Add range to your column using ExtendedProperties[^]
2. Handle ColumnChanging[^] event. In it check for ExtendedProperties and check value if there are some...
 
Share this answer
 
Comments
César Amorim 4-May-14 6:48am    
but i dont wanna handle column changing, i must handle the value in a specific row and column
Kornfeld Eliyahu Peter 4-May-14 6:50am    
From MSDN about ColumnChanging event: "Occurs when a value is being changed for the specified DataColumn in a DataRow."
César Amorim 4-May-14 8:16am    
thank you, will look trough

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