• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 197
  • Last Modified:

invisible row / hidden info in table

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
koger
Asked:
koger
  • 5
  • 3
1 Solution
 
Edo082297Commented:
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
 
MarciusCommented:
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
 
kogerAuthor Commented:
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
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

 
MarciusCommented:
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
 
kogerAuthor Commented:
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
 
MarciusCommented:
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
 
MarciusCommented:
Regarding the above comment, please note that the numbers are supposed to be under the options column, not the address.
0
 
MarciusCommented:
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
 
kogerAuthor Commented:
Thanx, it will do I filter all the rows where there is written
hidden column <> ''
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now