Can't set column width to zero on a datagrid

Can't set column width to zero on a datagrid

Post by Keith » Sat, 23 Apr 2005 11:55:04

Hello all. If anyone could help me I would appreicate it!

I am trying to set a column to zero width, as I need the data, but don't want
the user to see it. I have only a single datagrid on my form to simplify
debugging. I also have tried setting the width outside of the load event -
with the same result. I have tried to set the width directly and indirectly (as
currently shown in the code.)

I have tried this with width at -1, 0 (and 1) and the trace shows (0 for -1),
0 (or 1 respectively), the grid still shows around 15 points (or so) of size
for the column. Any ideas on how to get this to work? If the only answer is a
custom cellRenderer - could someone point me to a good example?

Here is the code:

onClipEvent (load) {
var dataArray = new Array();
dataArray[0] = {first:"Bill", second:"Jones", third:"123 St.", fourth:"City
A", fifth:"43212"};
dataArray[1] = {first:"Ted", second:"Smith", third:"456 Ave.", fourth:"City
B", fifth:"23454"};
dataArray[2] = {first:"Joe", second:"Test", third:"789 St.", fourth:"City C",
dataArray[3] = {first:"Dave", second:"Gates", third:"876 St.", fourth:"City
D", fifth:"76543"};
dataArray[4] = {first:"Betty", second:"Moore", third:"112 Blvd.",
fourth:"City E", fifth:"98765"};
dataArray[5] = {first:"Sam", second:"Johnson", third:"984 St.", fourth:"City
F", fifth:"77676"};
this.setStyle("vGridLines", Boolean(false));
col = this.getColumnAt(0);
col.width = 0;
col.headerText = "";
this.showHeaders = Boolean(false);

Can't set column width to zero on a datagrid

Post by I flash th » Sat, 23 Apr 2005 11:58:11

rather than set the width to zero, remove the column


The data is not lost - just not displayed