views:

254

answers:

0

I have a winform (C# VS2008 .net 3.5) with a Tab Control. Two of the pages on the tab control have Data Grid Views bound to the same Binding Source. This works fine.

However, there is a bug with Tab Pages in that Data Grid Views held in Tab Pages always show the first column of the bound table, whether or not it is set to visible at design time.

To work around this, you just set the column.visible property to false manually. This worked fine when I only had a single DGV bound to the BindingSource. With two bound, some strange things happen. I manually set both DGV's first column to visible = false, but sometimes only one actually takes, and the column still shows in the other. Further, when clicking a record in the DGV that is showing the first column, the following exception is raised:

InvalidOperationException - Operation is not valid because it results in a reentrant call to the SetCurrentCellAddressCore function.

Has anyone else experienced this or have a better fix for the column[0] problem with Tab Pages?

Thanks