locked
Custom Server Control Properties RRS feed

  • Question

  • User-277742030 posted

     I've Created my custom server control, it contains Devexpress controls,  here is example

     

    public class CustomPivot : CompositeControl
        {
            ASPxPivotGrid _Grid = new ASPxPivotGrid();
            public ASPxPivotGrid Grid
            {
                set { _Grid = value; }
                get { return _Grid; }
            }
            
            ASPxComboBox _TemplateCombo = new ASPxComboBox();
            public ASPxComboBox TemplateCombo
            {
                set { _TemplateCombo = value; }
                get { return _TemplateCombo; }
            }
    
            protected override void CreateChildControls()
            {
                Panel P = new Panel();
                P.Controls.Add(new LiteralControl("&lt;table><tr><td>"));
                P.Controls.Add(TemplateCombo);
                P.Controls.Add(new LiteralControl("&lt;/td></tr><tr><td>"));
                P.Controls.Add(Grid);
                P.Controls.Add(new LiteralControl("&lt;/td></tr></table>"));
    
                Controls.Add(P);
            }
        }
     
    everything works fine but when I put my control on form I need to change properties not only from designer, I need them to be visible like this
     
    <cc1:CustomPivot ID="CustomPivot1" runat="server">        
        <ChildrenControls>
            <MyPivotGrid ID="ASPxPivotGrid1" runat="server">
            <Fields>
                ...
                ...
                ...
            </Fields>
            <OptionsData />
            </MyPivotGrid>
    
            <MyComboBox ID="ASPxComboBox1" runat="server">
            <Items>
                ...
                ...
                ...
            </Items>
            <MyComboBox>
        </ChildrenControls>
     </cc1:CustomPivot>
      How can I achieve this goal?
      
    Monday, May 18, 2009 5:18 AM

Answers