Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Walking through the Columns

2 posts in DataWindow .NET Last posting was on 2004-11-18 20:21:42.0Z
Sean Durity Posted on 2004-11-18 19:13:53.0Z
Newsgroups: sybase.public.datawindow.net
Subject: Walking through the Columns
From: "Sean Durity" <sdurity@cornercap.com>
Organization: CornerCap Investment Counsel
Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Message-ID: <opshoc5cmgubr9ee@sdurity>
User-Agent: Opera M2/7.54 (Win32, build 3865)
X-Original-NNTP-Posting-Host: chow.cornercap.com
X-Original-Trace: 18 Nov 2004 11:13:49 -0800, chow.cornercap.com
Lines: 7
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 18 Nov 2004 11:13:50 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 18 Nov 2004 11:13:53 -0800
X-Trace: forums-1-dub 1100805233 10.22.108.75 (18 Nov 2004 11:13:53 -0800)
X-Original-Trace: 18 Nov 2004 11:13:53 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:759
Article PK: 125186

Is there a foreach construct for walking through all the columns on a
DataWindow? For example, I want to be able to
SetProperty("columnname.edit.displayonly","no") for each column. Or do I
have to handcode each one?

Sean Durity
CornerCap Investment Counsel


dfish Posted on 2004-11-18 20:21:42.0Z
From: dfish@_no_spam_sybase.com (Dave Fish [Team Sybase])
Newsgroups: sybase.public.datawindow.net
Subject: Re: Walking through the Columns
Organization: Sybase Professional Services
Reply-To: nospam_dfish@sybase.com_nospam
Message-ID: <419cfcd5.40311024@forums.sybase.com>
References: <opshoc5cmgubr9ee@sdurity>
X-Newsreader: Forte Free Agent 1.21/32.243
X-Original-NNTP-Posting-Host: vpn-uk-028.sybase.com
X-Original-Trace: 18 Nov 2004 12:21:38 -0800, vpn-uk-028.sybase.com
Lines: 53
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 18 Nov 2004 12:21:39 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 18 Nov 2004 12:21:42 -0800
X-Trace: forums-1-dub 1100809302 10.22.108.75 (18 Nov 2004 12:21:42 -0800)
X-Original-Trace: 18 Nov 2004 12:21:42 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:760
Article PK: 125187

You may be better off setting the Ready Only property on the
DataWindow itself:

<DW Control Name>.Modify("DataWindow.ReadOnly=<Yes or No>")

However there may be times when you want to iterate through the
columns of a DataWindow programmatically. When you do try something
like this:

int columnCount;
int counter=0;
string colNameNumber;
string columnName;
string modifyString;

columnCount=Int32.Parse(DwcDynamic.Describe("DataWindow.Column.Count"));

//Loop through the DataWindow columns and set the DisplayOnly property

do
{
counter++;
//Get the column name
colNameNumber = "#" + counter.ToString() + ".Name";
columnName = Dw1.Describe(colNameNumber);

//Set the display only property
modifyString = columnName + ".Edit.DisplayOnly=No";
Dw1.Modify(modifyString);
}

while(counter < columnCount);

Regards,
Dave Fish
Sybase

TeamSybase blogs: http://www.teamsybase.net/blogs

DataWindow.NET code examples available on CodeXchange:
http://datawindownet.codexchange.sybase.com

On 18 Nov 2004 11:13:53 -0800, "Sean Durity" <sdurity@cornercap.com>

wrote:

>Is there a foreach construct for walking through all the columns on a
>DataWindow? For example, I want to be able to
>SetProperty("columnname.edit.displayonly","no") for each column. Or do I
>have to handcode each one?
>
>Sean Durity
>CornerCap Investment Counsel