473,396 Members | 1,967 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,396 software developers and data experts.

Datagrid.CaptionText with DataSet?

I have a DataGrid that uses a DataSet with several tables as its
DataSource. Is there a way I can set the CaptionText of the DataGrid to
the table name when I click on a table?
*** Sent via Developersdex http://www.developersdex.com ***
Nov 21 '05 #1
3 1500
Hi,

Change it in the datagrid navigate event.

http://msdn.microsoft.com/library/de...igatetopic.asp

Ken
------------------
"Terry Olsen" <to******@hotmail.com> wrote in message
news:O%****************@TK2MSFTNGP12.phx.gbl...
I have a DataGrid that uses a DataSet with several tables as its
DataSource. Is there a way I can set the CaptionText of the DataGrid to
the table name when I click on a table?
*** Sent via Developersdex http://www.developersdex.com ***

Nov 21 '05 #2
Yeah, but I can't figure out how to get the Table Name of the selected
Table in the DataGrid, or at least the Index of the selected Table so I
can pull the Table Name from the DataSet.

*** Sent via Developersdex http://www.developersdex.com ***
Nov 21 '05 #3
Nevermind...figured it out. In the Datagrid Navigate event, I put this
line:

DataGrid1.CaptionText = DataGrid1.DataMember

Works like a charm. Thanks for the help!

*** Sent via Developersdex http://www.developersdex.com ***
Nov 21 '05 #4

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

Similar topics

0
by: Morné | last post by:
Hi how do I validate a text value in a datagrid e.g. the user is only allowed to type in a Y or a N. I specifically have a problem with using the PropertyDescriptorCollection. I get the...
2
by: michael walser | last post by:
display checkbox in datagrid. I find that there are 3 status: checked - check box with click icon unchecked - blank in check box unknown - click icon but color in gray..... How can I set the...
3
by: Alexander | last post by:
Hi, I am using a DataGrid and assign a DataTable as a DataSource to it: void ShowData() { DataTable myNewDataTable = new DataTable(); ... // fill table this.m_DataGrid1.DataSource =...
10
by: Robert Schuldenfrei | last post by:
Hi NG: I have the following code working. The GetProdStrtList() returns a DataTable called psTable. A Grid control is successfully bound to this table and displays correctly. I would like to...
7
by: Juan Romero | last post by:
Hey guys, please HELP I am going nuts with the datagrid control. I cannot get the damn control to refresh. I am using soap to get information from a web service. I have an XML writer output...
5
by: Genojoe | last post by:
I am using code from Help with two exceptions. (1) I increased the number of sample rows from 3 to 20, and (2) I anchored the datagrid to bottom of form so that I can change the size of the grid by...
4
by: Paul Ilacqua | last post by:
I'm filling the datagrid with no problem but I do not see a columnwidth property anywhere. How do you set the columnwidth property of the datagrid columns in code or manually? Thank you. Paul
4
by: gillcleeren | last post by:
I have a datagrid that has to be filled in a WinForms application. The data comes from an Oracle database. The normal procedure would be filling a dataset, but I have the problem that there are...
0
by: Patty05 | last post by:
I have a datagrid on a form that update properly when form loads. When the program runs and I type in/add a new row in the datagrid, it does not save the changes. Any help would be greatly...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
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,...

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.