To reproduce:
1. Add a RadGridView, a RadDataEntry, a RadBindingNavigator and a MS BindingNavigator.
2. Bind all of the above controls to absolutely the same BindingSource, e.g. Northwind.Categories table.
3. Click over the "Add" button of the RadBindingNavigator/MS BindingNavigator once. RadGridView displays the new record, but the RadDataEntry does not show it. Each next click of the "Add" button navigates the RadDataEntry to the previously added record.
Workaround:
//RadBindingNavigator:
this.radBindingNavigator1.BindingNavigatorElement.AddNewButton.Click += AddNewButton_Click;
private void AddNewButton_Click(object sender, EventArgs e)
{
this.radBindingNavigator1.BindingSource.MovePrevious();
this.radBindingNavigator1.BindingSource.MoveLast();
}
//MS BindingNavigator:
ToolStripButton addButton = (ToolStripButton)this.bindingNavigator1.Items[this.bindingNavigator1.Items.Count - 2] ;
if (addButton != null)
{
addButton.Click += addButton_Click;
}
private void addButton_Click(object sender, EventArgs e)
{
this.bindingNavigator1.BindingSource.MovePrevious();
this.bindingNavigator1.BindingSource.MoveLast();
}
To reproduce:
- Bind RadDataEntry to an object that has DateTime property.
- Change the value using the FreeFormDateTime mask type (enter 101010).
- The value is not changed.
Workaround:
RadDateTimePicker editor;
void radDataEntry1_EditorInitializing(object sender, EditorInitializingEventArgs e)
{
if (e.Property.Name == "obj")
{
editor = new RadDateTimePicker();
editor.Format = DateTimePickerFormat.Short;
editor.DateTimePickerElement.TextBoxElement.MaskType = MaskType.FreeFormDateTime;
RadMaskedEditBoxElement element = editor.DateTimePickerElement.TextBoxElement.TextBoxItem.Parent as RadMaskedEditBoxElement;
FreeFormDateTimeProvider provider = element.Provider as FreeFormDateTimeProvider;
provider.ParsedDateTime += provider_ParsedDateTime;
e.Editor = editor;
}
}
void provider_ParsedDateTime(object sender, EventArgs e)
{
editor.Value = (DateTime)(sender as FreeFormDateTimeProvider).Value;
}
To reproduce:
- Create a binding source and use the following datatable as its datasource:
static DataTable GetTable()
{
DataTable table = new DataTable();
table.Columns.Add("Str", typeof(string));
table.Columns.Add("Days", typeof(Days));
table.Rows.Add("Value 1", Days.Fri);
table.Rows.Add("Value 2", Days.Mon);
return table;
}
- Bind the data entry to the binding source
- You will notice that the enum value is not displayed.
Workaround:
void radDataEntry1_BindingCreating(object sender, BindingCreatingEventArgs e)
{
if (e.DataMember == "Days")
{
e.PropertyName = "SelectedIndex";
}
}