|
-
Nov 19th, 2002, 03:13 AM
#1
Thread Starter
Addicted Member
How to hide empty column ??
Hi all
I have DBGrid table contains four columns, some of these columns empty, What I like to do is, when I make search by item number I saw four columns, either these columns empty or full, this is right, but I do not like to see empty columns, even when I do search ,I do not know which columns are empty or full.
So, how I can write code to hide the empty columns.
Any help will be appreciated
Many Thanks in advance
-
Nov 19th, 2002, 05:14 AM
#2
Hyperactive Member
Simon Caiger
Documentation is like sex; when it's good, it's very, very good, and when it's bad, it's better than nothing.
-
Nov 19th, 2002, 05:32 AM
#3
Thread Starter
Addicted Member
Thank you
But, I like to put condition
Example: I like to say if any one of these columns, column2 or column3 or column4 are empty then hide it or hide them.
Any help in that plz?
Thank you
Originally posted by Simon Caiger
Make them zero width?
-
Nov 19th, 2002, 05:36 AM
#4
Hyperactive Member
If I understand you correctly,
Just make the column(s) that is/are empty, zero width.
So if columns 2 and 4 are empty, make them zero width and leave the other columns in the grid at normal width.
You could resize the visible columns to keep the grid the same overall size if you want.
Simon Caiger
Documentation is like sex; when it's good, it's very, very good, and when it's bad, it's better than nothing.
-
Nov 19th, 2002, 05:47 AM
#5
vbnt are you getting the feeling of de-ja-vu?
-
Nov 19th, 2002, 05:49 AM
#6
Thread Starter
Addicted Member
Many thanks for follow up Simon Caiger
What you have just said is right, but , when I search I did not know which of these columns are or is empty, that is the reason I need if statement to control them , if there is empty column or columns .
what really you said 100 % correct if I know the empty columns , but in the search time I do not know which is empty
I hope you get what I mean .
Thank you
Originally posted by Simon Caiger
If I understand you correctly,
Just make the column(s) that is/are empty, zero width.
So if columns 2 and 4 are empty, make them zero width and leave the other columns in the grid at normal width.
You could resize the visible columns to keep the grid the same overall size if you want.
-
Nov 19th, 2002, 05:57 AM
#7
Hyperactive Member
OK, I'm with you now (I hope).
Sorry I didn't fully understand your question to start with
Where is the column data held before it is displayed?
Is there any way you can process the data in the background before you display it and decide what columns will need to be visible?
Simon Caiger
Documentation is like sex; when it's good, it's very, very good, and when it's bad, it's better than nothing.
-
Nov 19th, 2002, 06:28 AM
#8
Thread Starter
Addicted Member
Thank you
I have database has many tables one of them has many columns,
in these columns there are four columns need to be fill of the items for some reason some of these columns need to be empty, what I mean is , some times I fill one column ,sometimes 2 , some times 3 some times 4 , for that reason some columns became empty , that Is why I wanna put code to conrol them all .
Is it clear idea now for you please ?
Originally posted by Simon Caiger
OK, I'm with you now (I hope).
Sorry I didn't fully understand your question to start with
Where is the column data held before it is displayed?
Is there any way you can process the data in the background before you display it and decide what columns will need to be visible?
-
Nov 19th, 2002, 06:56 AM
#9
Hyperactive Member
OK,
I did something similar to this getting data from a database once before.
I had a number of tables in the db with columns for date, time, data1, data2 etc.
What I wanted to do was sort the data before displaying it in a grid.
So, what I did was read the data into zero width (hidden) columns in the grid and then, when I had finished reading the database, transfer the data from the hidden columns to the visible columns.
In your case, after you have finished reading the db, you will see that some of the hidden columns are empty. Therefore you would make the corresponding (normally visible) column invisible also.
If you have a lot of data to read and sort, you could display a progress bar or some sort of file loading .ani
Simon Caiger
Documentation is like sex; when it's good, it's very, very good, and when it's bad, it's better than nothing.
-
Nov 19th, 2002, 07:11 AM
#10
Thread Starter
Addicted Member
Many thanks
I will try to apply that, but if you send me some database example ,it will be much better.
Thank you so much
Originally posted by Simon Caiger
OK,
I did something similar to this getting data from a database once before.
I had a number of tables in the db with columns for date, time, data1, data2 etc.
What I wanted to do was sort the data before displaying it in a grid.
So, what I did was read the data into zero width (hidden) columns in the grid and then, when I had finished reading the database, transfer the data from the hidden columns to the visible columns.
In your case, after you have finished reading the db, you will see that some of the hidden columns are empty. Therefore you would make the corresponding (normally visible) column invisible also.
If you have a lot of data to read and sort, you could display a progress bar or some sort of file loading .ani
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|