Subject | RE: [IBO] Column ordering |
---|---|
Author | Riho-Rene Ellermaa |
Post date | 2003-03-24T13:00:56Z |
Another thing. I want to show/hide some columns in runtime. Somehow i'm not succeeding in it
Grid->GridLinks->SafeCommaText=Str; //here I set the column ordering (data is read into Str from INI file)
//NB! There is a problem, when I hide some columns, then they are not saved into INI and I dont' have access to them anymore when I want to set them back to visible.
for(i=0;i<Grid->GridFieldCount;i++)
{ if(Grid->GridFields[i]->FieldName=="REG" || Grid->GridFields[i]->FieldName=="CREF" )
Grid->GridFields[i]->Visible=false;
}
This removes only first field, because the indexing changes as soon as I set one field unvisible and later I cant get back to this anymore.
There must be some other, more normal way to do manipulate the grid (or dataset)
Riho-Rene Ellermaa
senior programmer
Hansabank
-----Original Message-----
From: Paul Vinkenoog [mailto:paul@...]
Sent: Monday, March 24, 2003 12:15 PM
To: IBObjects@yahoogroups.com
Subject: RE: [IBO] Column ordering
Hi,
field number as it is in the SQL, regardless of any ordering you may
have specified in TIB_Query.FieldsIndex.
Grtz,
Paul
[Non-text portions of this message have been removed]
Grid->GridLinks->SafeCommaText=Str; //here I set the column ordering (data is read into Str from INI file)
//NB! There is a problem, when I hide some columns, then they are not saved into INI and I dont' have access to them anymore when I want to set them back to visible.
for(i=0;i<Grid->GridFieldCount;i++)
{ if(Grid->GridFields[i]->FieldName=="REG" || Grid->GridFields[i]->FieldName=="CREF" )
Grid->GridFields[i]->Visible=false;
}
This removes only first field, because the indexing changes as soon as I set one field unvisible and later I cant get back to this anymore.
There must be some other, more normal way to do manipulate the grid (or dataset)
Riho-Rene Ellermaa
senior programmer
Hansabank
-----Original Message-----
From: Paul Vinkenoog [mailto:paul@...]
Sent: Monday, March 24, 2003 12:15 PM
To: IBObjects@yahoogroups.com
Subject: RE: [IBO] Column ordering
Hi,
> You can get the actual grid column order using the TIB_Grid'sTo be more precise: TIB_Column.FieldNo *always* returns the 0-based
> GridFields prop. Iterate the GridFields from 0 thru GridFieldCount-1
> and you get the TIB_Column references. From there you can get
> FieldName, DisplayLabel, FieldNo (0-based field number in the query,
> not necessarily in the grid), etc. etc.
field number as it is in the SQL, regardless of any ordering you may
have specified in TIB_Query.FieldsIndex.
Grtz,
Paul
[Non-text portions of this message have been removed]