Add to Simple Binding pane of DataBinding dialog

I

Ian

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top