Link to home
Start Free TrialLog in
Avatar of koger
koger

asked on

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?
Avatar of Edo082297
Edo082297

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
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.
Avatar of koger

ASKER

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.
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 :)
Avatar of koger

ASKER

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.
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.
Regarding the above comment, please note that the numbers are supposed to be under the options column, not the address.
ASKER CERTIFIED SOLUTION
Avatar of Marcius
Marcius

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of koger

ASKER

Thanx, it will do I filter all the rows where there is written
hidden column <> ''