Solved

invisible row / hidden info in table

Posted on 1998-06-07
9
186 Views
Last Modified: 2010-04-04
I want to save some options within a table file, but the user may not see these options, so is it possible to make a whole record invisible in a dbgrid or in another way save some informations within a table file?
0
Comment
Question by:koger
[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:Edo082297
ID: 1351236
Hi Koger,
  Depending on what exactly the nature of the information is that you wish to hide, perhaps you could simply put a creative filter on the table that would effectively 'hide' the record?   Another idea would be to store the options somewhere else, like in the registry.

HTH

Edo
0
 
LVL 1

Expert Comment

by:Marcius
ID: 1351237
Hi Koger,

I need to clear a few things up here. You want to store a record which contains options inside a table which contains other data unrelated to the options ? This sounds like a very strange thing to be doing... Do you mean that you want to have a column within the table which is used to store options ?

If that is the case, then you need to define persistant fields within you dataset for the information you want to display. Then create columns within the DBGrid and set the columns to display the fields. If this is what you are intending to do, let me know and I will provide more information.
0
 

Author Comment

by:koger
ID: 1351238
To Marcius
Yep, I don't see why it is so strange to store options in a table, but anyway let me see what you wanted to show me.
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!

 
LVL 1

Expert Comment

by:Marcius
ID: 1351239
Sorry Koger, it is not strange to store options in a table. What is strange, is to store options is an *unrelated table*. You said that the options would be represented as a ROW, and I think that you mean a COLUMN. That is where the confusion come from.

Example table is like this:

MyTable (
  Name Varchar(40),
  Address Varchar(60),
  Options Varchar(10)
);

1. Open the fields editor for you dataset (double click on the TTable or TQuery etc)
2. Right click to bring up the menu, select add fields
3. Select all the field you require and then click OK.
4. You have now created persistant fields
5. Double click on your DBGrid to open the columns editor
6. Right click to open the menu and select add
7. Add as many columns as you need, in the example, add two columns. One for name and one for address
8. For each column created, set the fieldname property e.g name

So, when you run your application, only those fields for which you have created columns will be displayed in the DBGrid. You will be able to access the rest of the fields in the normal way (e.g FieldByName), or directly by referring to the persistant field (MyClientDatasetADDRESS.Value).
 
I hope this solves the problem. Let me know if you require any additional information :)
0
 

Author Comment

by:koger
ID: 1351240
Hi Marcius
Sorry my mistake as you said I meant to store the informationen in a column, but lets say I use 5 rows of this hidden column, these 5 rows will still be showed in the dbgrid, even if all the visible cells are empty, because the table contains 5 rows. It is these 5 rows I want to hide, if it is possible without using filter.
0
 
LVL 1

Expert Comment

by:Marcius
ID: 1351241
Let me confirm, you want to show an empty DBGrid when you have no data in the table except the options field. E.g.

Table1
Record    Name      Address        Options
1                                  1234
2                                  123
3                                  58

So give this data, you want to show name, address and options, but only if the name and address fields are not empty.

Is that correct ? If not, I need you to give me examples of what you mean.
0
 
LVL 1

Expert Comment

by:Marcius
ID: 1351242
Regarding the above comment, please note that the numbers are supposed to be under the options column, not the address.
0
 
LVL 1

Accepted Solution

by:
Marcius earned 50 total points
ID: 1351243
I have tried out my assumption, and I cannot see a way to stop the TTable from showing the empty fields without using a filter of a TQuery.

My suggestion is that you use a TQuery, since TTable is not very efficient at filtering data. Some like this would work:

Select Name, Address from MyTable
Where Name <> '' and Address <> ''

This will return only those rows which contain meaningful data.
0
 

Author Comment

by:koger
ID: 1351244
Thanx, it will do I filter all the rows where there is written
hidden column <> ''
0

Featured Post

Industry Leaders: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
find a node in VST 2 93
Tidtcpserver listening on multiports? 1 57
Firemonkey allowing RTL on android 6 79
Broadcast a message using ICS 2 51
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

710 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