> I've done very little winforms binding, but I had a similar problem in
ASP.NET

Shortly after posting, it occurred to me that it might have been better to
post this to the WinForms list, but it was too late :)

> and the answer was to create my own custom TypeDescriptor.

Hmm, using a custom TypeDescriptor never occurred to me, but I can see how
it could work.  It actually seems like a more generic (and thus elegant?)
way of handling this situation - there would be no need for any custom data
binding classes...  I will try to get it working quick, thanks!

--Daniel.


-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Geoff Taylor
Sent: 22 April 2008 03:10 PM
To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
Subject: Re: [ADVANCED-DOTNET] Handling user defined fields using custom
data binding

Hi,

I've done very little winforms binding, but I had a similar problem in
ASP.NET, and the answer was to create my own custom TypeDescriptor.  This
could then provide my own list of 'properties' (which may or may not have
been actual properties on the object) as well as providing my own
interception methods for getting and setting these 'proeprties'.

I don't have access to that code right now though, but let me know if you
try it and run into problems.

Cheers,

Geoff

On Tue, Apr 22, 2008 at 1:59 PM, Daniel Barla-Szabo <[EMAIL PROTECTED]>
wrote:

> Hi Guys,
>
>
>
> I am trying to solve a problem involving user-configurable "fields" on an
> object.   Typically, these fields are configured by each client, and it is
> quite easy to access them programmatically - a quick example would be:
>
>
>
> Employee emp = new Employee();
>
> emp.ExtendedFields["Some Field"].Value = "Hello World";
>
>
>
> However this does not fit in very nicely with the front-end code which
> generally uses data binding.  So I thought that I'd provide a way for data
> binding to work on these objects, but I guess I would have to write my own
> data binding classes to allow for this type of binding.  Essentially, I am
> looking for a way to inherit from System.Windows.Forms.Binding and
> override
> whatever needs to be overridden to make this work.
>
>
>
> I am not getting anywhere in this effort though - for starters, I cannot
> get
> a class that inherits from Binding to compile - I get "No overload for
> method 'Binding' takes '0' arguments" no matter what I try (it could be
> something simple that I am missing).
>
>
>
> There are obviously a lot of other ways to handle this as well, I just
> thought that this might be elegant.  Has anybody tried something similar,
> or
> am I going about this the wrong way in general?
>
>
>
> Regards,
>
>
> Daniel
>
>
> ===================================
> This list is hosted by DevelopMentor(R)  http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>

===================================
This list is hosted by DevelopMentorR  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to