Good Morning,
It would be nice to have the possibility to choose if use DateTimePicker or DatePicker during the 'AutoGeneratingField' event.
Something like:
if (e.PropertyType.Equals(typeof(DateTime)))
{
e.DateTimeMode = ...RadDataForm.DateTimeMode.OnlyDate, //(or .DateTime)
}
Because overriding the 'DataFormField' content with a RadDateTimePicker is a little bit intricate especially for the binding/reference losing.
The control is very helpful to make fast user forms prototipe but in this case it lose all its convenience.
Thank you,
Best Regards,
Enrico
The selection a RadComboBox hosted in RadDataForm gets cleared on commit changes. This happens when the RadComboBox is added in the EditTemplate and its IsEditable is set to True. Committing the edit clears the TextBox of the ComboBox, which clears the selection.
To work this around, subscribe to the EditEnding event of RadDataForm and clear the DataContext of the RadComboBox element.
private void RadDataForm_EditEnding(object sender, Telerik.Windows.Controls.Data.DataForm.EditEndingEventArgs e)
{
var dataForm = (RadDataForm)sender;
var myField = dataForm.ChildrenOfType<DataFormDataField>().FirstOrDefault(df => df.Name == "myField");
if (myField != null)
{
var comboBox = (RadComboBox)myField.Content;
comboBox.DataContext = null;
}
}