Solved

How can I force the TBDGrid to show data?

Posted on 1998-05-31
9
343 Views
Last Modified: 2008-02-01
I have a TBDGrid, when a user input an item no. at column 1, its description will be displayed.
For each item, it may or may not have the accessories.
How can the accessories data to be added to the same grid ?
0
Comment
Question by:yyjulie
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
9 Comments
 
LVL 1

Expert Comment

by:terencebeh
ID: 1462166
You can use the same procedure that you are filling the description to display the value.

Or, alternatively, write a procedure to retrieve the accessories from the database and use:
dbg.columns("accessories").value = ???

0
 

Author Comment

by:yyjulie
ID: 1462167
However, the accessory data should be added to the next row (not the same row) of the grid.  What can i do?
0
 
LVL 1

Expert Comment

by:terencebeh
ID: 1462168
in that case you use the dbgrid.movenext to fill in the next row for the accesories.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:yyjulie
ID: 1462169
Or let me to describe my situation clearer.

I have a form for borrowing computer hardware.
Within the form, it contains the master data. and a TDBGrid (unbound extended mode)  for detail data, i.e. the borrowed item, e.g. printer.

for each item, it may or may not have accessories, e.g. printer cable.

if a user input the item no. in the grid, its description will be displayed, at the same time, if the item has accessories, the accessories data will be shown in the following rows.

How can i do that?



0
 
LVL 6

Expert Comment

by:clifABB
ID: 1462170
If I understand, basically you want a tree view.

Would it be possible to use the Treeview control instead of a grid?

Another choice, which I have done in the past, it to have a second grid (hidden until needed) which acts like a dropdown list for whatever item you select on the main list.
0
 

Author Comment

by:yyjulie
ID: 1462171
Thank you, it's a great hint.


0
 

Author Comment

by:yyjulie
ID: 1462172
In fact, I have a question, is it possible that the data is saved only when a user press a command button after filling in data to the grid as he/she like.

I don't want the data immediately be updated or inserted by the unboundAddData event.

Can I use an array as the buffer to store the user's input, and then save the array to the database after pressing a command button? Is it a stupid way? Or is there already a method used in True DBGrid which can provide the same effect?
0
 
LVL 1

Accepted Solution

by:
terencebeh earned 20 total points
ID: 1462173
Well, you can use the dbgrid as AddItem Mode. And you will need some coding when you want to save the data. Example, loop through every row in the grid and update your database.
0
 

Author Comment

by:yyjulie
ID: 1462174
I've got an idea,  we can use XArray.
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month10 days, 19 hours left to enroll

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question