CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 "Hidden" Grid Columns are still visible

Print topic Send  topic

Author Message
Paul Shearing
Posted: 12/15/2005, 7:33 PM

I have read the thread about hiding grid columns but it is not a totally satisfactory solution. (Least, not the way I have coded it. :-/ )

The issue being addressed is as follows:

Many of the columns in a grid are text fields that have been converted to Links. The text field shows the data but the link, when clicked, uses an ID to open a new page showing details based on the item that was clicked. Standard stuff, and in order to do this, the (integer) Link ID has to be part of the data included in each grid row. Fair enough, but we need to hide these unsightly IDs from the user.

I have a grid that has no less than five columns that are links so I have five corresponding ID columns. (I have arranged it so that these are the rightmost columns in the grid.) In order to hide these ID fields, I use code in the grid's BeforeShow event like:

Function WEB_SandP_SEARCH_BeforeShow(Sender) 'WEB_SandP_SEARCH_BeforeShow @46-1D15121B

'Custom Code @157-73254650
' -------------------------
With WEB_SandP_SEARCH
.BuilderID.Visible = False
.Alt_BuilderID.Visible = False
.CurrentOwnerID.Visible = False
.Alt_CurrentOwnerID.Visible = False
.VesselID.Visible = False
.Alt_VesselID.Visible = False
.VesselEventID.Visible = False
.Alt_VesselEventID.Visible = False
.Company_1.Visible = False
.Alt_Company_1.Visible = False
.Company_2.Visible = False
.... and so on
End With
' -------------------------
'End Custom Code

This hides the column headings and the fields (and Alt_fields) but the column does not collapse to zero width. I have:

a) removed the offending trailing "& nbsp;" items (had to introduce a space in there so you could see it) from the html and this has removed the spray of vertical lines that I had initially - but there is still a visible empty column at the end (right-hand side) of the grid

b) set the cell properties of the table column in html to 0 pixels

There remains an empty column and it has visible left and right margins so it looks odd. For five columns, it totals just over a quarter of an inch wide.

So, any ideas how to render a grid column containing fields truly invisible?

Kind regards

Paul
Paul Shearing
Posted: 12/16/2005, 2:55 AM

Sorry, b) should read:

b) set the cell .Width property of the table columns in html to 0 pixels
peterr


Posts: 5971
Posted: 12/16/2005, 3:48 AM

Just a quick question: have you used the option "Add Panels to each column" in Grid Builder, or have you added those panels yourself to a previously created grid?
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Benjamin Krajmalnik
Posted: 12/16/2005, 7:26 AM

Paul,

You do not need to populate the ID field into your grid at all.
On the link, you set the Page the link goes to, and then in the link
parameters you add the parameter which is passed as an argument string in
the URL.

Paul Shearing
Posted: 12/16/2005, 10:06 AM

Benjamin

You're right and I'm racking my brains as to why I concluded that it was necessary to include the IDs in the grid and I think it stemmed from one of the CCS examples (involved copying an ID from one field to another) - but I can't remember which one. Anyway, i have removed the IDs and it works fine.

Thanks again.

Paul
Paul Shearing
Posted: 12/19/2005, 7:40 AM

I knew there was more to this. The problem arises when using the application builder. If, when using the application builder, you don't include the link IDs in the list of fields to be to be added to the grid rows, then their value is not available when you convert a text field to a link. The application builder seems to limit the fields available to only those added to the grid list - fair enough I s'pose. This was why I was adding the ID fields to the grid.

I get round this by refreshing the record's data source. If, for example, the record has a Table data source called Widgets, then I change the record's data source to type SQL and make it "SELECT * FROM Widgets". (I click on the red record border in Design view to display and modify the record's properties.) This then refreshes the record source and I can convert the TextBoxes to Links 'cos all fields are now available. Having make this change you can revert to Table: Widgets and the Record retains the full field list.

However, it may well be that this kludge is deleterious to efficiency where a) the total number of fields in a table is significantly greater than the number of fields being displayed and/or b) the full recordset contains memo, binary or image fields - more data is being pulled from the server - much of which is then not being used.

Hmmm. :-/

Paul
Paul Shearing
Posted: 02/08/2006, 4:01 AM

Thought I would revisit this one because i have now found out the cause of the original problem.

If your grid columns or column headings contain any non-breaking spaces then they cannot be rendered invisible.

Thus the solution is to edit out all ocurrences of [& nbsp;] and then use the BeforeShow event to set the visibility.

Paul Shearing 8-)

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.