bindingsource in partial

P

pihentagy

Hi all!

Is it possible to have a bindingsource in a partial class?
Well it is possible, but I have the following issues:
- this.components is defined in the .designer.cs file. If I call my
own initialization method before the GUI's one, I will not have
this.components. If I call it after, it's too late, because I'd like
to bind it to a GUI component
- my IDE (#develop) doesn't display my own partial class as part of
the Form. What should I do to make it understood that my class belongs
to that?

ps: the reason for requiring it to be in a partial is to generate that
piece of code.

Thanks
Gergo
 
P

Pavel Minaev

Hi all!

Is it possible to have a bindingsource in a partial class?
Well it is possible, but I have the following issues:
- this.components is defined in the .designer.cs file. If I call my
own initialization method before the GUI's one, I will not have
this.components. If I call it after, it's too late, because I'd like
to bind it to a GUI component

Not sure what exactly you mean here, but it's not "too late" to do
whatever you want after the call to InitializeComponent() - you can
most certainly bind it to anything that way.
- my IDE (#develop) doesn't display my own partial class as part of
the Form. What should I do to make it understood that my class belongs
to that?

Again, the question is unclear. What exactly do you mean by
"displaying .. partial class as part of the form"?
 
P

pihentagy

Hi all!

Ok, here is what I would like to achieve
- I would like to have a BindingSource defined in a custom partial
(not in myform.cs, not in myform.designer.cs, but in another partial,
say myform.datasource.cs - reasoning: my partial may be autogenerad
more than once, and I don't want to merge it with the hand-written or
the designer generated form)
- I would like to have design time support for it (I would like to be
that bindingsource listed at the bottom of my form and I would like to
be able to bind that datasource to a widget WITH THE DESIGNER)

Is that obvious now what I would like to achieve?

thanks
Gergo
 

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

Top