Professional Web Applications Themes

Custom Templated Databound Control or derived control? - ASP.NET Building Controls

Hi, I want to create a control that performs much like a datalist but I want more control over how the <ItemTemplate> contents is set out on the page. For example I have a 4 by N grid of images to set out on the page, how the first row is slightly different in taht the first image is twice the size of the rest, so the first row only have 3 images the remaining rows have 4 images. Would I be best to derive my own control from Repeater? What methods will I need to override to alter the ...

  1. #1

    Default Custom Templated Databound Control or derived control?

    Hi,

    I want to create a control that performs much like a datalist but I want
    more control over how the <ItemTemplate> contents is set out on the page.
    For example I have a 4 by N grid of images to set out on the page, how the
    first row is slightly different in taht the first image is twice the size of
    the rest, so the first row only have 3 images the remaining rows have 4
    images. Would I be best to derive my own control from Repeater? What
    methods will I need to override to alter the layout to design required.

    The information about the images is stored in a collection of classes so I
    will need to use the DataBinder.Eval(...) method.

    TIA


    MattC


    MattC Guest

  2. #2

    Default Re: Custom Templated Databound Control or derived control?

    Matt,

    I think you can still use the DataRepeater control for this, by handling the
    ItemDataBound event and 'merging' the first two cells of the first row in
    there.

    HTH
    Altaf
    --------------------------------------------------------------------------------
    All that glitters has a high refractive index.
    [url]www.mendhak.com[/url]

    "MattC" <mm.com> wrote in message
    news:e9w9DPC8FHA.2176TK2MSFTNGP14.phx.gbl...
    > Hi,
    >
    > I want to create a control that performs much like a datalist but I want
    > more control over how the <ItemTemplate> contents is set out on the page.
    > For example I have a 4 by N grid of images to set out on the page, how the
    > first row is slightly different in taht the first image is twice the size
    > of the rest, so the first row only have 3 images the remaining rows have 4
    > images. Would I be best to derive my own control from Repeater? What
    > methods will I need to override to alter the layout to design required.
    >
    > The information about the images is stored in a collection of classes so I
    > will need to use the DataBinder.Eval(...) method.
    >
    > TIA
    >
    >
    > MattC
    >

    S.M. Altaf [MVP] Guest

Similar Threads

  1. Problems with Templated Databound control
    By paululvinius@hotmail.com in forum ASP.NET Building Controls
    Replies: 1
    Last Post: December 1st, 08:15 PM
  2. Templated Custom Control
    By Gary K in forum ASP.NET Building Controls
    Replies: 2
    Last Post: June 9th, 11:09 PM
  3. Custom Templated Control not rendering asp.net controls correctly
    By news.microsoft.com in forum ASP.NET Building Controls
    Replies: 1
    Last Post: April 9th, 11:41 AM
  4. Replies: 1
    Last Post: April 8th, 11:23 PM
  5. attempt to create my own templated custom control
    By Lloyd Dupont in forum ASP.NET General
    Replies: 0
    Last Post: July 27th, 06:50 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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