Data Grid

R

Randy Hersom

When my DataGrid shows only one table, it seems highly user unfriendly to
make the user expand the table list and select the only table on the list in
order to get to their data. How can the programmmer programmatically make
these selections for the user? I'm using C++.
 
Y

Ying-Shen Yu[MS]

Hi Randy,
You mean the datagrid is just showing a node of the table name instead
of the content when you are using one table?
Yes, this situation may happen when you only set the DataSource
property of the DataGrid to your DataSet, but leave the DataMember
property unset.
You may try setting the DataMember property to your table name in
corresponding dataset, This is easy in Design-time ,since the property will
show you your table name.You can also do it in run-time by simply giving an
string of your table name to the DataMember property. Thanks!

Does this solve your problem?
I'd appreciate if you could post a reply on the NG to let us know the
status of your problem,
Thanks for using MSDN Newsgroup!


Best regards,

Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.

--------------------
| From: "Randy Hersom" <[email protected]>
| Subject: Data Grid
| Date: Thu, 11 Sep 2003 16:20:00 -0400
| Lines: 7
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.windowsforms
| NNTP-Posting-Host: adsl-156-203-113.clt.bellsouth.net 66.156.203.113
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.windowsforms:52175
| X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms
|
| When my DataGrid shows only one table, it seems highly user unfriendly to
| make the user expand the table list and select the only table on the list
in
| order to get to their data. How can the programmmer programmatically make
| these selections for the user? I'm using C++.
|
|
|
|
 
R

Randy Hersom

When I posted this, my DataGrid would show up with no words and two cryptic
buttons in the upper left corner. Clicking on the lower button would reveal
the word Objective. Clicking on the word Objjective would then load the
desired data.

I got my intended result by adding this line just before the end of my
form_load
this->dataGrid1->NavigateTo(0,"Objective");

I will look at the DataMember info and see how that might help me in the
future.

Thanks

Randy Hersom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top