Re: CheckBox control and IPostBackDataHandler
From: Joe Fallon (jfallon1_at_nospamtwcny.rr.com)
Date: 12/02/04
- Next message: Joe Fallon: "Re: Computed columns in datagrid"
- Previous message: Joe Fallon: "Re: Problem with Sorting Web Datagrid"
- In reply to: Francois: "CheckBox control and IPostBackDataHandler"
- Next in thread: Francois: "Re: CheckBox control and IPostBackDataHandler"
- Reply: Francois: "Re: CheckBox control and IPostBackDataHandler"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 2 Dec 2004 00:29:57 -0500
I recommend you get the book "ASP.Net Server Controls and Components" by
Kothari and Datye.
You might want to try some code like this:
override bool IPostBackDataHandler.LoadPostData( string postDataKey,
NameValueCollection postCollection)
I think you are not allowed to us Public, Private, Protected on Interface
methods.
You also have to prefix the method with the Interface name.
Please let me know if that works for you.
--
Joe Fallon
"Francois" <francois@bettinghouses.com_NOSPAM> wrote in message
news:uqWiPy11EHA.3500@TK2MSFTNGP09.phx.gbl...
> Hi,
>
> I am trying to implement a custom control that extends the standard
> System.Web.UI.WebControls.CheckBox control. In the .Net class library
> reference it is said that CheckBox Implements IPostBackDataHandler
> interface. I want to override the 2 methods defined by that interface but
> i
> do not see in the CheckBox class that the methods of IPostBackDataHandler
> are implemented. But they should be as the class is said to implement the
> interface.
> The 2 methods defined by IPostBackDataHandler are:
> - RaisePostDataChangedEvent
> - LoadPostData
>
> Then how cam I create a custom control that extends CheckBox and overrides
> RaisePostDataChangedEven and LoadPostData?
>
> I tried to following code but it does not compile, it says the
> CheckBoxValue.cs: 'Bos.CustomControls.CheckBoxValue.LoadPostData(string,
> System.Collections.Specialized.NameValueCollection)': no suitable method
> found to override
>
> using System;
> using System.Collections;
> using System.Collections.Specialized;
> using System.Web.UI;
> using System.Web.UI.WebControls;
> using System.ComponentModel;
>
> namespace Bos.CustomControls
> {
>
> public class CheckBoxValue : System.Web.UI.WebControls.CheckBox
> {
>
> private bool isChanged = false;
>
> public CheckBoxValue()
> {
> }
>
> public bool IsChanged
> {
> get
> {
> return this.isChanged;
> }
> set
> {
> this.isChanged = value;
> }
> }
>
> protected override void OnCheckedChanged(EventArgs e)
> {
> IsChanged = true;
> base.OnCheckedChanged(e);
> }
>
> protected override bool LoadPostData( string postDataKey,
> NameValueCollection postCollection)
> {
> }
>
> }
> }
>
> Best regards,
>
> Francois
>
>
>
>
- Next message: Joe Fallon: "Re: Computed columns in datagrid"
- Previous message: Joe Fallon: "Re: Problem with Sorting Web Datagrid"
- In reply to: Francois: "CheckBox control and IPostBackDataHandler"
- Next in thread: Francois: "Re: CheckBox control and IPostBackDataHandler"
- Reply: Francois: "Re: CheckBox control and IPostBackDataHandler"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|