Add to Simple Binding pane of DataBinding dialog

Discussion in 'ASP .Net Web Controls' started by Ian, Jun 3, 2004.

  1. Ian

    Ian Guest

    I have sub-classed the Page class in order to provide some base
    properties and methods that every page on my site will need access to.

    I would like to have these things show up in the Simple Binding
    window of the DataBindings dialog. I then found this site
    (http://msdn.microsoft.com/library/d.../vsintro7/html/vxurfDataBindingsDialogBox.asp)
    which says:

    The tree view displays these objects: the Page object; any data source
    that derives from the Component class; any objects instantiated in the
    page's InitializeComponent method; and any objects that implement the
    IEnumerable interface.

    So I decided to try to make my objects show up there. Ok, so the
    items I wasnted to bind to were already properties of my subclass of
    the Page object and they werent showing up, so I decided to try making
    a component. I made a new component class and made it a property of
    my Page subclass. It didnt show up. I tried instantiating it in an
    InitializeComponent method, but this didnt work either and I suspect
    that this is somehow tied to being the last class in the inheritance
    hierarchy before the parser-generated class. Since the data I want to
    expose isn't multi-row, making it IEnumerable doesnt really make much
    sense.

    For instance, I'd like people to be able to bind to the user's login
    name. So I'd like to add a property to my page sub-class:

    public string UserName
    { get { return Context.User.Identity.Name; } }

    I'd really like to make my properties/objects show up in the simple
    binding tree because I'm trying to make it as easy as possible to make
    pages based on my inherited base class, and, for better or for worse,
    having to type manual binding expressions is probably going to be too
    difficult for my "authoring" user base.

    The only things I've ever seen in this pane are the Page object
    (effectively useless) and the DataSet. I cant see that these two
    classes share any attributes that would flag them for inclusion. I'm
    assuming that somehow their designers are Siting them in the WebForms
    designer's container, but this all appears to be happenning behind the
    scenes and the Design namespaces are still woefully under-documented.

    Can anyone clear this up? or offer other suggestions for making my
    properties show up there?

    Ian
    Ian, Jun 3, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dales
    Replies:
    18
    Views:
    936
    Jim Cheshire [MSFT]
    Dec 3, 2003
  2. Ian
    Replies:
    0
    Views:
    270
  3. Patrick.O.Ige
    Replies:
    0
    Views:
    753
    Patrick.O.Ige
    Aug 31, 2006
  4. Knute Johnson
    Replies:
    2
    Views:
    424
    Knute Johnson
    Nov 10, 2007
  5. Ian

    Add to Simple Binding pane of DataBinding dialog

    Ian, Jun 3, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    117
Loading...

Share This Page