By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,458 Members | 1,215 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,458 IT Pros & Developers. It's quick & easy.

Stop a DataGrid from showing related tables

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.