Completed
Last Updated: 20 Nov 2014 14:07 by Richard
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 13 Nov 2014 07:07
Category:
Type: Bug Report
0
FIX. RadDataEntry - New record is not displayed when clicking the "Add" button of the RadBindingNavigator/MS BindingNavigator
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();
}
1 comment
Richard
Posted on: 13 Nov 2014 10:38
A better workaround is to set Radgridview.Datasource to null before invoking addButton. Then set Radgridview.Datasource back to it original source. But formely make sure to set the AutoGenerateColumns property to false.