Hi,
I have a wingrid bound to a table that has some date columns. For one of the date columns, I want to allow the user to change the date, but to never blank it out. Is there a property setting either on the grid, row, column or cell that I can set that will prevent this from happening? I'm trying to achieve this without having to write any underlying code to get this to happen.
I also have this same sort of issue with a date/time control field on a form. My assumption there is that I only need to set the Nullable property to false for the date/time control and that should prevent the user from blanking out the date/time field on the form.
NOTE: I did notice that on the wingrid there is a Nullable propery for the column, but it appears to only control how null values get saved to the db, not to prevent a null value from being set in the column.
Any help you can give in regards to this would be greatly appreciated
Thank you!
Steve
Hi Mike .. Actually, I found out that I had the Disallow option for the Nullable property. I didn't realize it was an enum and didn't write the correct syntax to expose the option. Still learning!
Thanks Mike ... I was able to use the AllowDBNull property on the data column to prevent the user from entering a blank ...
Hi Steve,
I have a Disallow option on mine. You must be using an older version of the grid from before that option was added.
So you have a few choices:
Hi Mike,
I looked up the Nullable property on the column and I don't see a setting for Disallow. I see the following options:
0 - NullableAutomatic
1 - NullableNull
2 - NullableEmptyString
Which one of these would be the Disallow option or am I using the wrong propery all together? Here is the code I'm using to try and set the Nullable property (among other things):
{
if (column.Hidden == false)
column.PerformAutoResize(
PerformAutoSizeTypeVisibleRows);
column.Nullable.Equals(??);
}
Thanks,
The Nullable property on the column has a setting for Disallow.