473,406 Members | 2,281 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Stop a DataGrid from showing related tables

I have a Windows Forms DataGrid bound to a Table within a DataSet.

The Table is related to others within the DataSet.

The DataGrid allows the user to surf through related tables. I don't want
that behavior; I want the DataGrid to just show the one table. How is this
accomplished?

I tried using this...

DataGridTableStyle tableStyle = new DataGridTableStyle();
tableStyle.RowHeadersVisible = false;

....which gets rid of the [+] symbols on the left side of the DataGrid, but
the user can still surf to related tables using the Tab key on the keyboard.

Thanks!

Patrick
Nov 16 '05 #1
4 1172
Hello Patrick,

There's a property on the grid called AllowNavigation. Set this one to false
and you are done.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://www.x-unity.net/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Patrick" <ne*******@devzoo.com> wrote in message
news:ez**************@TK2MSFTNGP09.phx.gbl...
I have a Windows Forms DataGrid bound to a Table within a DataSet.

The Table is related to others within the DataSet.

The DataGrid allows the user to surf through related tables. I don't want
that behavior; I want the DataGrid to just show the one table. How is this
accomplished?

I tried using this...

DataGridTableStyle tableStyle = new DataGridTableStyle();
tableStyle.RowHeadersVisible = false;

...which gets rid of the [+] symbols on the left side of the DataGrid, but
the user can still surf to related tables using the Tab key on the keyboard.
Thanks!

Patrick


Nov 16 '05 #2
Ah! That worked. Thanks.

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote
in message news:ur**************@TK2MSFTNGP09.phx.gbl...
Hello Patrick,

There's a property on the grid called AllowNavigation. Set this one to false and you are done.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://www.x-unity.net/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Patrick" <ne*******@devzoo.com> wrote in message
news:ez**************@TK2MSFTNGP09.phx.gbl...
I have a Windows Forms DataGrid bound to a Table within a DataSet.

The Table is related to others within the DataSet.

The DataGrid allows the user to surf through related tables. I don't want that behavior; I want the DataGrid to just show the one table. How is this accomplished?

I tried using this...

DataGridTableStyle tableStyle = new DataGridTableStyle();
tableStyle.RowHeadersVisible = false;

...which gets rid of the [+] symbols on the left side of the DataGrid, but the user can still surf to related tables using the Tab key on the

keyboard.

Thanks!

Patrick

Nov 16 '05 #3
I want to do the same thing except I want the data binding off that is in my code when i do everything you have said minus this line/statement:

this.dg_list.SetDataBinding(this.ds_list, "user_list");

my datagrid shows up blank. I dont want it to be databound.
Now, if i remove this code, I have to set navigation back on to see the values in my one table "user_list".

User_list is a table being populated via a data-adapter via a stored procedure. I just need to do it this way....and there are no updates, deletes, or inserts being done...Any suggestions?

---
Posted using Wimdows.net NntpNews Component -

Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.
Nov 16 '05 #4
I want to do the same thing except I want the data binding off that is in my code when i do everything you have said minus this line/statement:

this.dg_list.SetDataBinding(this.ds_list, "user_list");

my datagrid shows up blank. I dont want it to be databound.
Now, if i remove this code, I have to set navigation back on to see the values in my one table "user_list".

User_list is a table being populated via a data-adapter via a stored procedure. I just need to do it this way....and there are no updates, deletes, or inserts being done...Any suggestions?

---
Posted using Wimdows.net NntpNews Component -

Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.
Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Frosty | last post by:
Hi I am using the VS xsd designer to create a strongly typed dataset. The dataset is apparently successfully created, with no warnings or errors given. Is it not then to be expected that this...
3
by: PeterZ | last post by:
G'day, After doing much searching and pinching bits of ideas from here there and everywhere I came up with a fairly 'clean' solution of including a comboBox into a dataGrid column. You can...
3
by: Darryn Ross | last post by:
Hi, How do i get my datagrid to display the contents of two related tables setup in my access database, so i can see the plus/minus sign to expand retract the Child details? Regards Darryn
1
by: SR | last post by:
Plz Help I have a dataset which has tables area,goals,objectives,tactics each area can have many goals,each goal can have many objectives,each objectives can have many tactics they are...
8
by: Matt Theule | last post by:
While stepping through an ASP.NET project, I found that data was being inserted into my database even though I was not stepping through the code that inserted the data. I have a single page with...
2
by: enak | last post by:
I can not get my datagrid to page. I have a datagrid that I can sort 2 of the columns. This works great. I added paging and when I display the dg it shows 5 pages. (I am showing page numbers at...
5
by: tshad | last post by:
Is there a way to carry data that I have already read from the datagrid from page to page? I am looking at my Datagrid that I page through and when the user says get the next page, I have to go...
2
by: yuanh23 | last post by:
Hi, I have 3 talbes "customers","orders","details". i wanna to use 3 datagrids to show those tables. and when the selected row in parent talbe changes, the selected row in child table changes...
3
by: Aaron | last post by:
Hi, It is possible to establish relationships between tables within a dataset and this allows some useful features. For example, given a row from a table you can use GetParentRow,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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...
0
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,...
0
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...

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.