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.

Inheriting from a datawindow control

4 posts in DataWindow .NET Last posting was on 2004-12-14 18:57:46.0Z
David Gerdner Posted on 2004-12-14 14:11:31.0Z
From: "David Gerdner" <dave@gerdner.org>
Newsgroups: sybase.public.datawindow.net
Subject: Inheriting from a datawindow control
Lines: 56
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: ool-43558c0b.dyn.optonline.net
X-Original-NNTP-Posting-Host: ool-43558c0b.dyn.optonline.net
Message-ID: <41bef493$1@forums-1-dub>
Date: 14 Dec 2004 06:11:31 -0800
X-Trace: forums-1-dub 1103033491 67.85.140.11 (14 Dec 2004 06:11:31 -0800)
X-Original-Trace: 14 Dec 2004 06:11:31 -0800, ool-43558c0b.dyn.optonline.net
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:1043
Article PK: 125468

I have a Base Class project in which I've placed some C# objects, such as a
base button class. When I build an application I use these objects rather
than the native C# objects. I've tried to do that with a datawindow
control, but the events do not trigger. Sample code follows. Note two
things:

* When I paste this u_dw control onto a form and call the Set SortOnClick()
method, it executes and the MessageBox displays.

* However, when I click on the datawindow (on a column, header, anywhere)
the Click event does not trigger.

Any ideas on what I'm doing wrong?

using System;
using System.Windows;
using System.Windows.Forms;
using Sybase.DataWindow;

namespace BaseClass
{

public class u_dw : Sybase.DataWindow.DataWindowControl
{
public u_dw()
{
//
// TODO: Add constructor logic here
//
}
private Boolean b_sort_on_click = false;
private void InitializeComponent()
{
//
// u_dw
//
this.Click += new System.EventHandler(this.u_dw_base_Click);
}

public void u_dw_base_Click(object sender, System.EventArgs e)
{
MessageBox.Show("Sort on column click 1.");
}
public void SetSortOnClick(Boolean bset)
{
b_sort_on_click = bset;
MessageBox.Show("SetSort Done.");
}

}
}


Fernando Martinez Posted on 2004-12-14 16:43:26.0Z
Sender: 44c3.41beef8d.1804289383@sybase.com
From: Fernando Martinez
Newsgroups: sybase.public.datawindow.net
Subject: Re: Inheriting from a datawindow control
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <41bf182e.4a55.1681692777@sybase.com>
References: <41bef493$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 14 Dec 2004 08:43:26 -0800
X-Trace: forums-1-dub 1103042606 10.22.241.41 (14 Dec 2004 08:43:26 -0800)
X-Original-Trace: 14 Dec 2004 08:43:26 -0800, 10.22.241.41
Lines: 13
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:1050
Article PK: 125476

David,

In your datawindow wrapper class remove the u_dw_base_Click
event and replace it with the following:

protected override void OnClick(EventArgs e) {
base.OnClick(e) ;
MessageBox.Show("Sort on column click 1.");
}

You should set up all of your events this way.

Fernando Martinez


Fernando Martinez Posted on 2004-12-14 16:45:35.0Z
Sender: 44c3.41beef8d.1804289383@sybase.com
From: Fernando Martinez
Newsgroups: sybase.public.datawindow.net
Subject: Re: Inheriting from a datawindow control
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <41bf18af.4a63.1681692777@sybase.com>
References: <41bf182e.4a55.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 14 Dec 2004 08:45:35 -0800
X-Trace: forums-1-dub 1103042735 10.22.241.41 (14 Dec 2004 08:45:35 -0800)
X-Original-Trace: 14 Dec 2004 08:45:35 -0800, 10.22.241.41
Lines: 6
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:1051
Article PK: 125478

David,

I'm not sure why an underscore (_) was placed before
OnClick but that needs to be removed.

Fernando Martinez


David Gerdner Posted on 2004-12-14 18:57:46.0Z
From: "David Gerdner" <dave@gerdner.org>
Newsgroups: sybase.public.datawindow.net
References: <41bef493$1@forums-1-dub> <41bf182e.4a55.1681692777@sybase.com>
Subject: Re: Inheriting from a datawindow control
Lines: 19
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: ool-43558c0b.dyn.optonline.net
X-Original-NNTP-Posting-Host: ool-43558c0b.dyn.optonline.net
Message-ID: <41bf37aa@forums-1-dub>
Date: 14 Dec 2004 10:57:46 -0800
X-Trace: forums-1-dub 1103050666 67.85.140.11 (14 Dec 2004 10:57:46 -0800)
X-Original-Trace: 14 Dec 2004 10:57:46 -0800, ool-43558c0b.dyn.optonline.net
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:1058
Article PK: 125484

Thanks!

<Fernando Martinez> wrote in message
news:41bf182e.4a55.1681692777@sybase.com...
> David,
>
> In your datawindow wrapper class remove the u_dw_base_Click
> event and replace it with the following:
>
> protected override void OnClick(EventArgs e) {
> base.OnClick(e) ;
> MessageBox.Show("Sort on column click 1.");
> }
>
> You should set up all of your events this way.
>
> Fernando Martinez