0

In order to use a C1DropDownControl inside a C1InputPanel I need to define a class that inherits from the InputControlHost class and then invoke the desired control's constructor, like this:

public class InputC1DropDownControl : InputControlHost
{
    public InputC1DropDownControl()
        : base(new C1DropDownControl())
    {

    }
}

By doing that I can see the C1DropDownControl inside the C1InputPanel (it's some kind of a special ComboBox) but I can't access all of it's properties. So, my question is: how can I access the C1DropDownControl properties from an InputC1DropDownControl object (which obviously inherits from a different class)?

2 Answers2

0

You can just use the Control property and then cast:

var control = (C1DropDownControl) controlHost.Control;
// Use the various properties
Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
0

The InputControlHost has a property called Control. You should be able to do something like

C1DropDownControl hostedControl = Control as C1DropDownControl;
hostedControl.Whatever...

in your InputC1DropDownControl class.

Thomas Hetzer
  • 1,537
  • 13
  • 24