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.

DataWindow basics

4 posts in DataWindow .NET Last posting was on 2004-11-13 00:24:47.0Z
sdurity Posted on 2004-11-10 20:54:00.0Z
Sender: 1c6a.41927778.1804289383@sybase.com
From: sdurity
Newsgroups: sybase.public.datawindow.net
Subject: DataWindow basics
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <41927fe8.1d30.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 10 Nov 2004 12:54:00 -0800
X-Trace: forums-1-dub 1100120040 10.22.241.41 (10 Nov 2004 12:54:00 -0800)
X-Original-Trace: 10 Nov 2004 12:54:00 -0800, 10.22.241.41
Lines: 30
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:690
Article PK: 125119

I have not used DataWindows in PowerBuilder, so please
forgive me if these are simple questions. I am using the
eval version to see if DW.Net is a good choice for building
our database app in .Net.

I would like a master-detail form. I created three data
windows in the Designer, one for the master info, one for
the detail, and one for the unique identifier/description.
What I would like is for the user to have a drop down list
(really a drop down datawindow) of all the existing uniques
identifiers. The user selects one. The master and detail
information should then be shown for possible editing.

I have the master and detail datawindow controls on my
WinForm. I can connect to the database and fill them. I put
a filter on the detail information. I also have the drop
down datawindow on the unique identifier. However, I can't
find the event (or whatever) to trigger a change on the
currently showing row in the master datawindow. It just lets
the user change the value.

Similarly, if I use page down to move to different master
records, I haven't found a way to wire that to the detail
control and cahnge the filter.

Finally, I would like the user to be able to have
auto-complete in the dropdown datawindow, but not be able to
change the unique identifier.

Can any of this be done in DW.Net?


Bruce Armstrong [TeamSybase] Posted on 2004-11-12 02:43:43.0Z
From: "Bruce Armstrong [TeamSybase]" <NOCANSPAM_bruce.armstrong@teamsybase.com>
Newsgroups: sybase.public.datawindow.net
Subject: Re: DataWindow basics
Organization: TeamSybase
Reply-To: NOCANSPAM_bruce.armstrong@teamsybase.com
Message-ID: <qi68p0pafv5khmhoqa5rsednmj0u1em2qf@4ax.com>
References: <41927fe8.1d30.1681692777@sybase.com>
X-Newsreader: Forte Agent 2.0/32.652
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: 68-190-226-38.la-cbi.charterpipeline.net
X-Original-Trace: 11 Nov 2004 18:43:39 -0800, 68-190-226-38.la-cbi.charterpipeline.net
Lines: 126
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 11 Nov 2004 18:43:40 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 11 Nov 2004 18:43:43 -0800
X-Trace: forums-1-dub 1100227423 10.22.108.75 (11 Nov 2004 18:43:43 -0800)
X-Original-Trace: 11 Nov 2004 18:43:43 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:699
Article PK: 125126


On 10 Nov 2004 12:54:00 -0800, sdurity wrote:

>I have the master and detail datawindow controls on my
>WinForm. I can connect to the database and fill them. I put
>a filter on the detail information. I also have the drop
>down datawindow on the unique identifier. However, I can't
>find the event (or whatever) to trigger a change on the
>currently showing row in the master datawindow. It just lets
>the user change the value.

ItemChangedEventHandler

Handles the DataWindowControl ItemChanged event.

[Visual Basic]
Public Delegate Function Sub ItemChangedEventHandler( _
ByVal Object sender, _
ByVal ItemChangedEventArgs e _
)


[C#]
public delegate void ItemChangedEventHandler(
object sender,
ItemChangedEventArgs e
)


>Similarly, if I use page down to move to different master
>records, I haven't found a way to wire that to the detail
>control and cahnge the filter.

RowFocusChangingEventHandler

Handles the DataWindowControl RowFocusChanging event.

[Visual Basic]
Public Delegate Function Sub RowFocusChangingEventHandler( _
ByVal Object sender, _
ByVal RowFocusChangingEventArgs e _
)


[C#]
public delegate void RowFocusChangingEventHandler(
object sender,
RowFocusChangingEventArgs e
)

>Finally, I would like the user to be able to have
>auto-complete in the dropdown datawindow, but not be able to
>change the unique identifier.

That requires handing the EditChanged event and doing a bit of
processing to find the matching row.

EditChangedEventHandler

Handles the DataWindowControl EditChanged event.

[Visual Basic]
Public Delegate Function Sub EditChangedEventHandler( _
ByVal Object sender, _
ByVal EditChangedEventArgs e _
)

[C#]
public delegate void EditChangedEventHandler(
object sender,
EditChangedEventArgs e
)

Something along the lines of...

Dim dept_name As String
Dim findarg As String
Dim dwchild As Sybase.DataWindow.DataWindowChild
Dim row As Integer
dept_name = e.Data
dwchild = dw_1.GetChild("dept_id")
findarg = "Match ( lower ( dept_name ) , '^" +
LCase(dept_name) + "' )"
row = dwchild.FindRow(findarg, 1, dwchild.RowCount())
<that's a start anyway>
Bruce Armstrong [TeamSybase]
http://www.teamsybase.com

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

Two 3rd party books on developing with PowerBuilder
http://www.pb9books.com?source=newsgroups

Need code sample? Check out CodeXchange:
http://www.codexchange.sybase.com

Preach the gospel at all times. If necessary, use words. - Francis of Assisi
http://www.needhim.org

---------------------------------------------------------------------
NOTE:

If you are using Google to post messages to the newsgroups, you will
*not* receive a reply. Messages posted through Google never reach the
Sybase newsgroup server, so we don't see them in order to respond to
them. You should post your question using a standard newsgroup reader
or the web based newsreaders at my.sybase.com or www.pfcguide.com.
Google is great for searching the Sybase newsgroups, but you can't post
to them from there.

---------------------------------------------------------------------
DISCLAIMER:

This newsgroup message is only intended for the recipient. Given that it
is a posting to a public newsgroup, that means if you can read this
message then you are the recipient. This message may contain information
that is confidential and protected from disclosure. And then again,
it may not.

Given that TeamSybase members are not employees of Sybase, the contents
of this message do not necessarily represent the views or policies of
Sybase. Given that TeamSybase is a diverse group of users of Sybase
products, the contents of this message do not necessarily represent the
views of a significant number of the members of TeamSybase. Given that the
author has multiple personalities and hears voices in his head, the contents
of this message do not necessarily represent his own views.


sdurity Posted on 2004-11-12 22:18:06.0Z
Sender: 3e6e.419517ce.846930886@sybase.com
From: sdurity
Newsgroups: sybase.public.datawindow.net
Subject: Re: DataWindow basics
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4195369e.4113.1681692777@sybase.com>
References: <qi68p0pafv5khmhoqa5rsednmj0u1em2qf@4ax.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 12 Nov 2004 14:18:06 -0800
X-Trace: forums-1-dub 1100297886 10.22.241.41 (12 Nov 2004 14:18:06 -0800)
X-Original-Trace: 12 Nov 2004 14:18:06 -0800, 10.22.241.41
Lines: 55
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:704
Article PK: 125136


> On 10 Nov 2004 12:54:00 -0800, sdurity wrote:
>
> >I have the master and detail datawindow controls on my
> >WinForm. I can connect to the database and fill them. I
> put >a filter on the detail information. I also have the
> drop >down datawindow on the unique identifier. However, I
> can't >find the event (or whatever) to trigger a change on
> the >currently showing row in the master datawindow. It
> just lets >the user change the value.
>
> ItemChangedEventHandler
>
> Handles the DataWindowControl ItemChanged event.

Thanks, this is what I was looking for. For others, I added
this code specifically:
private void dataWindowControl1_ItemChanged(object sender,
Sybase.DataWindow.ItemChangedEventArgs e) {
if (e.ColumnName.Equals("indexcode")) {
dataWindowControl1.ScrollToRow(dataWindowControl1.
FindRow("indexcode =
'"+dataWindowControl1.GetText()+"'",1,
dataWindowControl1.RowCount));
}
}

> >Similarly, if I use page down to move to different master
> >records, I haven't found a way to wire that to the detail
> >control and cahnge the filter.
>
> RowFocusChangingEventHandler
> Handles the DataWindowControl RowFocusChanging event.

I used the changed event instead. Any problems with that?

private void dataWindowControl1_RowFocusChanged(object
sender, Sybase.DataWindow.RowFocusChangedEventArgs e) {
dataWindowControl2.SetFilter("indexcode = +"'"+
dataWindowControl1.GetItemString(dataWindowControl1.
CurrentRow,"indexcode")+"'");
dataWindowControl2.Filter();
}

> >Finally, I would like the user to be able to have
> >auto-complete in the dropdown datawindow, but not be able
> to >change the unique identifier.
>
> That requires handing the EditChanged event and doing a
> bit of processing to find the matching row.
>
> EditChangedEventHandler

Hadn't tried this, yet. The default behavior might be
adequate. I do have a memory error when I close my
application, but I'll submit that separately next week.


Bruce Armstrong [TeamSybase] Posted on 2004-11-13 00:24:47.0Z
From: "Bruce Armstrong [TeamSybase]" <NOCANSPAM_bruce.armstrong@teamsybase.com>
Newsgroups: sybase.public.datawindow.net
Subject: Re: DataWindow basics
Organization: TeamSybase
Reply-To: NOCANSPAM_bruce.armstrong@teamsybase.com
Message-ID: <3tkap0pjoqb9nqu8ddt0i2g7e9t31oas3c@4ax.com>
References: <qi68p0pafv5khmhoqa5rsednmj0u1em2qf@4ax.com> <4195369e.4113.1681692777@sybase.com>
X-Newsreader: Forte Agent 2.0/32.652
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: 68-190-226-38.la-cbi.charterpipeline.net
X-Original-Trace: 12 Nov 2004 16:24:42 -0800, 68-190-226-38.la-cbi.charterpipeline.net
Lines: 81
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 12 Nov 2004 16:24:44 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 12 Nov 2004 16:24:47 -0800
X-Trace: forums-1-dub 1100305487 10.22.108.75 (12 Nov 2004 16:24:47 -0800)
X-Original-Trace: 12 Nov 2004 16:24:47 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:706
Article PK: 125135


On 12 Nov 2004 14:18:06 -0800, sdurity wrote:

>Thanks, this is what I was looking for. For others, I added
>this code specifically:
>private void dataWindowControl1_ItemChanged(object sender,
>Sybase.DataWindow.ItemChangedEventArgs e) {
> if (e.ColumnName.Equals("indexcode")) {
> dataWindowControl1.ScrollToRow(dataWindowControl1.
> FindRow("indexcode =
>'"+dataWindowControl1.GetText()+"'",1,
> dataWindowControl1.RowCount));
> }
>}

Look good, except that the argument to the ItemChanged event should
tell you what the text is, so you should be able to use that rather
than the GetText call. (Unless I'm misunderstanding what you're
doing, I don't have a real good mental picture of it).

>I used the changed event instead. Any problems with that?
>
>private void dataWindowControl1_RowFocusChanged(object
>sender, Sybase.DataWindow.RowFocusChangedEventArgs e) {
> dataWindowControl2.SetFilter("indexcode = +"'"+
> dataWindowControl1.GetItemString(dataWindowControl1.
> CurrentRow,"indexcode")+"'");
> dataWindowControl2.Filter();
>}

Nothing wrong with that at all, the RowFocusChanged should work
equally as well.

>Hadn't tried this, yet. The default behavior might be
>adequate. I do have a memory error when I close my
>application, but I'll submit that separately next week.

Cool...


Bruce Armstrong [TeamSybase]
http://www.teamsybase.com

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

Two 3rd party books on developing with PowerBuilder
http://www.pb9books.com?source=newsgroups

Need code sample? Check out CodeXchange:
http://www.codexchange.sybase.com

Preach the gospel at all times. If necessary, use words. - Francis of Assisi
http://www.needhim.org

---------------------------------------------------------------------
NOTE:

If you are using Google to post messages to the newsgroups, you will
*not* receive a reply. Messages posted through Google never reach the
Sybase newsgroup server, so we don't see them in order to respond to
them. You should post your question using a standard newsgroup reader
or the web based newsreaders at my.sybase.com or www.pfcguide.com.
Google is great for searching the Sybase newsgroups, but you can't post
to them from there.

---------------------------------------------------------------------
DISCLAIMER:

This newsgroup message is only intended for the recipient. Given that it
is a posting to a public newsgroup, that means if you can read this
message then you are the recipient. This message may contain information
that is confidential and protected from disclosure. And then again,
it may not.

Given that TeamSybase members are not employees of Sybase, the contents
of this message do not necessarily represent the views or policies of
Sybase. Given that TeamSybase is a diverse group of users of Sybase
products, the contents of this message do not necessarily represent the
views of a significant number of the members of TeamSybase. Given that the
author has multiple personalities and hears voices in his head, the contents
of this message do not necessarily represent his own views.