467,926 Members | 2,032 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,926 developers. It's quick & easy.

GridView problem on Page 2+ of a TabControl

I have a four-page tabcontrol with a gridview on each page. I have the
primary key column of each gridview set to hidden (visible = false),
but it still shows up on all but the first page. Anyone else see this
behavior? How might I correct it?

Jan 26 '07 #1
  • viewed: 2410
Share:
2 Replies
Minor correction - I am dealing with datagridviews. Also, I thought I
would detail my subsequent recreating of the problem using a more
simplified environment and fewer variables:

I just reproduced this scenario on another PC with VS 2005 SP1
installed and got the same behavior. To do so, I created a new database
with three simple tables - a parent table and two child tables in the
SQL 2005 Express database. I created primary key columns in each table
and foreign key columns in the two child tables. I defined
relationships in the database for both child tables with the parent
table (child.foreignkey to parent.primarykey).

I created a new dataset in a new VB windows project which automatically
imported those relationships as well. I dragged the parent table from
the project data sources window onto a form as a datagridview as well
as the two related child tables listed below the parent table node.
Running the form showed correct relational behavior, and the primary
key columns I set to visible = false on both child datagridviews were,
indeed, hidden.

I then added a tabcontrol to the form and dragged each child
datagridview to a seperate tab of the tabcontrol. Upon running the
form, the datagridview on the first tab still displays correctly, while
whichever datagridview is on the second tab fails to hide the primary
key column as specified. When I change the tabs collection properties
of the tabcontrol to move Tab2 to the top, and therefore be displayed
first, then the datagridview on Tab2 displays correctly, while that on
Tab 1 (now displayed as the second tab) fails to hide the "hidden"
column.

I can't imagine why this behavior would be by design, so I am assuming
it is a bug. Unfortunately, I also can't imagine that, if it *is* a
bug, they wouldn't consider it important enough to include a fix in
SP1.

Anyone else wrestling with this? How are you getting around it?

On Jan 25, 9:57 pm, "Richard Carpenter" <rumble...@hotmail.comwrote:
I have a four-page tabcontrol with a gridview on each page. I have the
primary key column of each gridview set to hidden (visible = false),
but it still shows up on all but the first page. Anyone else see this
behavior? How might I correct it?
Jan 26 '07 #2
I did find another who had the same problem. I guess persistence in my
Google searching pays off. ;)

http://groups.google.com/group/micro...1afeda1ef320bb
On Jan 26, 10:49 am, "Richard Carpenter" <rumble...@hotmail.com>
wrote:
Minor correction - I am dealing with datagridviews. Also, I thought I
would detail my subsequent recreating of the problem using a more
simplified environment and fewer variables:

I just reproduced this scenario on another PC with VS 2005 SP1
installed and got the same behavior. To do so, I created a new database
with three simple tables - a parent table and two child tables in the
SQL 2005 Express database. I created primary key columns in each table
and foreign key columns in the two child tables. I defined
relationships in the database for both child tables with the parent
table (child.foreignkey to parent.primarykey).

I created a new dataset in a new VB windows project which automatically
imported those relationships as well. I dragged the parent table from
the project data sources window onto a form as adatagridviewas well
as the two related child tables listed below the parent table node.
Running the form showed correct relational behavior, and the primary
key columns I set tovisible= false on both child datagridviews were,
indeed, hidden.

I then added atabcontrolto the form and dragged each childdatagridviewto a seperate tab of thetabcontrol. Upon running the
form, thedatagridviewon the first tab still displays correctly, while
whicheverdatagridviewis on the second tab fails to hide the primary
key column as specified. When I change the tabs collection properties
of thetabcontrolto move Tab2 to the top, and therefore be displayed
first, then thedatagridviewon Tab2 displays correctly, while that on
Tab 1 (now displayed as the second tab) fails to hide the "hidden"
column.

I can't imagine why this behavior would be by design, so I am assuming
it is a bug. Unfortunately, I also can't imagine that, if it *is* a
bug, they wouldn't consider it important enough to include a fix in
SP1.

Anyone else wrestling with this? How are you getting around it?

On Jan 25, 9:57 pm, "Richard Carpenter" <rumble...@hotmail.comwrote:
I have a four-pagetabcontrolwith a gridview on each page. I have the
primary key column of each gridview set to hidden (visible= false),
but it still shows up on all but the first page. Anyone else see this
behavior? How might I correct it?- Hide quoted text -- Show quoted text -
Jan 26 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Scott Gunn | last post: by
3 posts views Thread by NateDawg | last post: by
8 posts views Thread by AG | last post: by
1 post views Thread by jmdolinger | last post: by
1 post views Thread by =?Utf-8?B?VmFuZXNzYQ==?= | last post: by
4 posts views Thread by Peter | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.