|
BindingSource bind = new BindingSource();
bind.DataSource = GetTheGridTable();
//To set the DataSource of the grid.
this.gridGroupingControl1.DataSource = bind;
//To bind the data source of grid with BindingNavigator.
this.bindingNavigator1.BindingSource = this.gridGroupingControl1.DataSource as BindingSource;
this.gridGroupingControl1.ShowNavigationBar = true;
//Event triggering
this.bindingNavigator1.BindingSource.AddingNew += new AddingNewEventHandler(BindingSource_AddingNew);
//Event customization
void BindingSource_AddingNew(object sender, AddingNewEventArgs e)
{
//To update the RecordNavigationBar when the records are added through BindingNavigator
this.gridGroupingControl1.RecordNavigationBar.Update();
}
|