bindingsource in partial

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • pihentagy

    bindingsource in partial

    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
  • Pavel Minaev

    #2
    Re: bindingsource in partial

    On Jul 11, 5:26 pm, pihentagy <pihent...@gmai l.comwrote:
    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 InitializeCompo nent() - 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"?

    Comment

    • pihentagy

      #3
      Re: bindingsource in partial

      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.datasour ce.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
      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 InitializeCompo nent() - 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"?

      Comment

      Working...