thx. that works
So I have in Tabcontrol select
private void mainTabControl_Selecting(object sender, TabControlCancelEventArgs e)
{ // 090818 tested
// make sure the test sample DGV is loaded
if (e.TabPage.Text.Contains("Test Sample"))
{
if (ucTestSample == null) return;
int iRowCur = 0;
if (ucTestSample.getRowCnt() > 0) return;
ucTestSample.showTestDataDGV(iRowCur);
//addMsg("@debug mainTabControl_Selecting test sample rowcount" + ucTestSample.getRowCnt());
}
} // make sure the test sample DGV is loaded when Test Sample tab page is selected
In form load event
// note TestSampleTabpage is the non tabpage containign a user control with DGV
this.TestSampleTabPage.Controls.Add(ucTestSample = new UserControlTestSample());
//TestSampleTabPage.Select(); // don't ever run this line in form load or you may end<br/> // end with wierd display of the navigator with red jagged red lines
//TestSampleTabPage.Show(); // not needed
int idebugTSRowCnt = ucTestSample.getRowCnt();
mainTabControl.Select();
In the User control
internal void showTestDataDGV(int idx){
testSampleDataGridView.Show();
if (idx <= 0) idx = 0;
// not required for making DGV not lazy:
bindingNavigatorPositionItem.Focus();
bindingNavigatorPositionItem.Text = "" + (idx + 1);
}