473,769 Members | 6,203 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
2 2634
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.foreignk ey to parent.primaryk ey).

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...@hotm ail.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...@hotm ail.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.foreignk ey to parent.primaryk ey).

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 childdatagridvi ewto a seperate tab of thetabcontrol. Upon running the
form, thedatagridview on the first tab still displays correctly, while
whicheverdatagr idviewis 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 thedatagridview 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...@hotm ail.comwrote:
I have a four-pagetabcontrolw ith 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
6014
by: Scott Gunn | last post by:
In my app I want to have a run-time generated tab showing various controls - for instance a form for a user to fill in. I have a tab page in a hidden tabcontrol and all I want to do is clone it to another tabcontrol and show it. Giving me the ability to show maybe 5, 6 , 7 or more of the same tab page. Any Ideas? Scott
3
13753
by: NateDawg | last post by:
I'm reposting this. I'm kinda in a bind untill i get this figured out, so if anyone has some input it would sure help me out. Ok, I’ve noticed a few gridview problems floating around the forum. Everyone wants to do a java confirmation box when a user clicks the delete button. Fair enough, basic user design rules state that you should always confirm a delete action. There is also a consensus that the best way to do this is a template...
5
4838
by: Dick | last post by:
I have a GridView bound to an ObjectDataSource. I have a Button that calls GridView.DataBind. I want the row that is selected before the DataBind to still be selected afterwards. This happens automatically if the data doesn't change. But if records have been added or deleted then it looks as if some code is necessary: I've done this by using GridView.SelectedValue to get the key value of the currently selected Row and then by itterating...
8
8535
by: AG | last post by:
ASP.NET 2.0, VS 2005 I have a gridview with paging enabled, bound to an objectdatasource. Both were dropped on to the page and configured via the wizards. Basically working as expected. The gridview's databind method is apparently called when the page is loaded as I have no code calling the databind method. How can I keep the gridview from databinding automatically and control it myself?
1
3528
by: jmdolinger | last post by:
Hi all, I'm a newbie to Atlas (and recently ASP.NET) after coming from a long Java background, also have done quite a bit with an Ajax.NET/ASP.NET 1.1 project, but it was basically all javascript, nothing really having to do with ASP.NET... I'm attempting to put together an application that consists of several GridView controls each bound to some xml data. Each table exists in its own update panel. The two effects I'm going for are:
4
11900
by: Jeff | last post by:
Hi, I have a ASP.NET 2.0 Web Application. Many of the pages use the ASP.NET GridView with paging and sorting. One of the columns of this Gridview is a template column (LinkButton). The data being retrieved and showed in this GridView produce more than one page of data. A given user clicks on the first row hyper link on the Grid on the first page, then the first row hyper link color changes to look as "visited". Then the user navigates to...
4
9790
by: mohaaron | last post by:
This seems like it should be simple to do but for some reason I have been unable to make it work. I would like to databind a SqlDataSource to a GridView during the click event of a button. This sounds easy but the next requirement is that the GridView is editable. So I have included the SelectCommand and the UpdateCommand on the SqlDataSource to allow the GridView to be editable. I have now been able to get the GridView to display data...
1
1940
by: =?Utf-8?B?VmFuZXNzYQ==?= | last post by:
Hi all! I have 4 pages in a TabControl. Depending on a selection on the first page, I enable the second page and disable the third one, and vice-versa. What I want is that when the user try to select the disabled page I select the following one. For example, if the second page is disabled, if he select this one, I want to select the third page. I tried to use Selecting event, using "e.Cancel==true" to the disabled page
4
8842
by: Peter | last post by:
I want to call a JavaScript on PageIndexChanged event, how do I do that? Thank You Peter
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10045
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9863
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7409
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5299
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3562
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.