I am using an LLGBLGenDataSource2 with a FormView. I would like to set one of the field values to 0 whenever the form field value is blank. The datasource control has AllFieldsKeepEmptyStringAsValue="True"
The form has a PeterBlum IntegerTextBox for the UI control. The control behavior is that it returns an integer when the textbox is valid or null when the textbox is blank or has an illegal value.
I put a PreProcessValueToSet in a partial class for that entity. When I enter a valid value and step through the fields in the debugger, I see that it hits that field in the switch statement and evaluates it correctly.
protected override void PreProcessValueToSet(IEntityField2 fieldToSet, ref object valueToSet)
{
switch(enumValue)
{
case: ProductFieldIndex.ProductId
break;
case: ProductFieldIndex.UnitsOnOrder
if(valueToSet == null)
{
valueToSet = 0;
}
break;
}
}
However, when I leave the field blank, the field index is never hit. I assume that the DataSourceControl is skipping over the field because it sees the null value. Is there anyway I can get that null value to evalaute it?