Building a custom table control

Ask a Question related to ASP.NET Building Controls, Design and Development.

  1. #1

    Default Building a custom table control

    Hi Everyone,

    I am new to Server control development and I need some serious help with
    something. I want to build a control that will allow the developer using the
    control to define columns so I am building a composit control and inheriting
    from the Table web control. My problem is how do I set up the control so
    that columns can be set at design time much like
    <asp:Table...>
    <asp:TableRow ...>
    <asp:TableCell...></asp:TableCell>
    <asp:TableCell...></asp:TableCell>
    </asp:TableRow>
    </asp:Table>

    I need to set it up so that the site developer can impliment a new table
    cell in design time. Can someone please point me in the right direction?

    Thank you
    I am Sam Guest

  2. Similar Questions and Discussions

    1. Building a control adapter for a custom control
      Folks, Has anyone tried to build a webcontrol adapter for a custom control (from a 3rd party)? All the examples I have looked at (including those...
    2. Methods for building Web Custom Control that emits Javascript
      Hi: Someone knows if exists some method for sketches, as with UML, the development of a Web Custom Control that emits Javascript? Agile...
    3. Building a custom control with nested templates
      Hi, I'm trying to create a templated custom asp.net server control with nested templates and I'm having some problems in getting the nesting to...
    4. Building a custom control that implement table server control
      Hi, I want to create a custom control that implements the table htmlcontrol. In my webform page I want to include that custom control and add...
    5. Using Table control in a custom composite control. Control does not render properly in design time.
      All, I have written a very simple custom composite control that includes a control of type System.Web.UI.WebControls.Table. The control...
  3. #2

    Default Re: Building a custom table control

    Hi Sam,

    What you probably need to do is define two public properties

    private int _numberOfCells
    int numberOfCells
    {
    get{...;}
    set {...;}
    }
    private int _numberOfRows
    int numberOfRows
    {
    get{...;}
    set {...;}
    }

    then you need to set these properties when you instantiate the server
    controls either in the html mark up or programatically.

    then you can just write a for loop (probabally a nested one)
    and for each iteration write out a new cell (for a row or a column.)

    as a server controls has no design time HTML interface like a user control
    you will have to produce the output programatically.

    HTH

    cheers

    martin.



    "I am Sam" <IamSam@discussions.microsoft.com> wrote in message
    news:C048B369-DDCD-45EA-AD4D-5F16B362096E@microsoft.com...
    > Hi Everyone,
    >
    > I am new to Server control development and I need some serious help with
    > something. I want to build a control that will allow the developer using
    > the
    > control to define columns so I am building a composit control and
    > inheriting
    > from the Table web control. My problem is how do I set up the control so
    > that columns can be set at design time much like
    > <asp:Table...>
    > <asp:TableRow ...>
    > <asp:TableCell...></asp:TableCell>
    > <asp:TableCell...></asp:TableCell>
    > </asp:TableRow>
    > </asp:Table>
    >
    > I need to set it up so that the site developer can impliment a new table
    > cell in design time. Can someone please point me in the right direction?
    >
    > Thank you

    Martin Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139