I have a databound grid. I have added WebDateTimeEdit1 to BirthDate column of my grid. this is how Iam adding this..
UltraWebGrid1.DisplayLayout.Bands[0].Columns[5].EditorControlID = WebDateTimeEdit1.UniqueID;
UltraWebGrid1.DisplayLayout.Bands[0].Columns[5].Type = Infragistics.WebUI.UltraWebGrid.
.Custom;
UltraWebGrid1.DisplayLayout.Bands[0].Columns[5].Header.Title =
;
BirthDate is a required field, and I have a RequiredFieldValidator, one's I added the WebDateTimeEdit required field validator is not working.
Is there a way that I can set the RequiredFieldValidator on serverside, or is it a bug that WebDateTimeEdit and RequiredFieldValidator doesn't work together.
Iam using 2008vol3, C#. any insight would be helpful. thanks.
You need to connect your validator to the WebGrid column, instead of to the editor control used by that column.
The following help article, taken from our online help documentation of NetAdvantage for .NET 2008 Volume 3, shows how to do this:Validating Cells
The article uses a RangeValidator in its example. It's simple enough to replace this with a RequiredFieldValidator.
I checked all the properties...requiredfieldvalidator (controltovalidate) is set to UltraWebGrid1,
my grid column BirthDate (validators) is set to BirthDateValidator.
thanks,
thank you very much. I appreciate your quick responses. thanks.
I believe that this requires further in-depth investigation. I've passed the information on this thread to Devleoper Support, who will create a support case for you. They'll work with you to investigate why the validator isn't functioning when using a WebDateTimeEdit control as the editor of your grid column, as well as to find any resolutions other than not using the editor control.
Nullable property was not set. I changed my code ...
//UltraWebGrid1.DisplayLayout.Bands[0].Columns[5].EditorControlID = WebDateTimeEdit1.UniqueID; //UltraWebGrid1.DisplayLayout.Bands[0].Columns[5].Type = Infragistics.WebUI.UltraWebGrid.ColumnType.Custom; //UltraWebGrid1.DisplayLayout.Bands[0].Columns[5].Header.Title = "mm/dd/yyyy"; //this.WebDateTimeEdit1.Nullable = true;
still not working. so I commented my code for WebDateTimeEdit. now my RequiredFieldValidator is working for BirthDate.
Since you have validators working on other columns, it's likely that the validators are all configured correctly. Perhaps there's other configuration, whether of the grid or the editor, that's affecting this behavior.
Have you set the Nullable property of your WebDateTimeEdit control to true? This may affect whether or not the grid views the corresponding cell's value as null.
If you have set Nullable to true and this is still occurring, you might also consider temporarily not using the WebDateTimeEdit control as the column's editor to confirm whether or not it makes a difference. This obviously not a fix; I ask because it may help further research.
one more thing, my grid has FirstName, Gender and Relationship fields which have Required Field Validators and they are working, only BirthDate column has both RequiredFieldValidator and WebDateTimeEdit. the combination doesn't seem to work. don't understand what Iam missing here..
thanks.