BChernick
Mon Jul 28 09:39:00 CDT 2008
? Excuse me. Terminology question. I thought I was creating a 'server
control'. In any case the user control declaration within the ItemTemplate
of the repeater has the runat="Server" tag.
"Cowboy (Gregory A. Beamer)" wrote:
> You are one step away from making your own server control (compiled
> control), so congratulations. You have gone beyond whee we were taking you,
> although the code is still in the ASP.NET code behind. If you move it to a
> server control (you do not have to do this now, btw), you will have achieved
> a bit of elegance.
>
> I hope this does not sound insincere, as I truly love it when someone thinks
> beyond the problem to the solution. And, I am truly happy for you on finding
> a solution. :-)
>
> --
> Gregory A. Beamer
> MVP, MCP: +I, SE, SD, DBA
>
> Subscribe to my blog
>
http://gregorybeamer.spaces.live.com/lists/feed.rss
>
> or just read it:
>
http://gregorybeamer.spaces.live.com/
>
> ********************************************
> | Think outside the box! |
> ********************************************
> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
> news:75F1C828-23B8-49C4-9BD4-9F05D78E2DCA@microsoft.com...
> >I believe I've found a solution. How 'elegant' it is is another matter.
> >
> > The repeater events were no use at all. I put a couple of public
> > variables
> > into a module and overrode the usercontrol's render routine. At the
> > beginning, I did a
> > writer.Write("<Table id='" + tableId + "'>")
> >
> > Every time that grouping key changes I output
> > writer.Write("</tr></table><Table>")
> >
> > I put a <td> around every control and created a new <tr> after every 7
> > instances.
> > Since I also stored the max number of records in the module, I output
> > writer.Write("</table>") at the end.
> >
> > All tables but the first are set to style='visibility:hidden'. Next step
> > is
> > to write some Javascript.
> >
> > "Cowboy (Gregory A. Beamer)" wrote:
> >
> >> The ItemDataBound is useful for injecting code at the end of the event,
> >> so
> >> it can be used to end the rows and start a new row.
> >>
> >> I will have to delve into ItemCreated, as it is designed to circumvent
> >> the
> >> natural coding, so you end up having to put the data back into the item.
> >> I
> >> am not sure I will get a chance until later tonight or this weekend, so
> >> if
> >> you find an answer, respond back and I will avoid the extra work. :-)
> >>
> >> --
> >> Gregory A. Beamer
> >> MVP, MCP: +I, SE, SD, DBA
> >>
> >> Subscribe to my blog
> >>
http://gregorybeamer.spaces.live.com/lists/feed.rss
> >>
> >> or just read it:
> >>
http://gregorybeamer.spaces.live.com/
> >>
> >> ********************************************
> >> | Think outside the box! |
> >> ********************************************
> >> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
> >> news:356FE4DB-6A9C-4AC1-9073-0375248B5A39@microsoft.com...
> >> > Perhaps I should restate this. The group of records has a main key
> >> > field
> >> > (call it pk1). It also has a second subgrouping key (call it pk2).
> >> > While
> >> > all the records have the same pk1, there is no predicting how many will
> >> > have
> >> > any given value of pk2. So you could have 20 records with pk2 = 1, 1
> >> > record
> >> > with pk2 = 2, 6 records with pk2 = 3, etc. The records have to be
> >> > displayed
> >> > 2-dimensionally in their respective subgroups, and using a squarish
> >> > custom
> >> > control that prevents use of more conventional grid layouts.
> >> >
> >> > In any case, If I understood Cowboy correctly, I should insert html
> >> > into
> >> > the
> >> > page programmatically but I've never done this before and I'm having a
> >> > hard
> >> > time finding the right reference. I've a feeling that I just don't
> >> > know
> >> > the
> >> > right key word yet. (And putting a
> >> > 'Page.Response.Output.Write("</tr>test<tr>")' in the ItemCreated event
> >> > just
> >> > puts text at the top of the page.)
> >> >
> >> > Perhaps my real question now is how do I (can I) insert html at a
> >> > specific
> >> > point in the page using the repeater ItemCreated event?
> >> >
> >> >
> >> > "sloan" wrote:
> >> >
> >> >>
> >> >> You might want to read these:
> >> >>
> >> >>
http://aspnet.4guysfromrolla.com/articles/052103-1.aspx
> >> >>
http://aspnet.4guysfromrolla.com/articles/052103-1.aspx
> >> >>
> >> >> The DataList may be more of what you're after, but I'm having a little
> >> >> trouble discerning your layout need.
> >> >>
> >> >> ......
> >> >>
> >> >> But the Repeater might be correct as well.
> >> >>
> >> >> The repeater offers the most flexiblity, but requires you to do the
> >> >> most
> >> >> work (rule of thumb).
> >> >>
> >> >> Sorry I can't be more helpful than that.
> >> >>
> >> >>
> >> >>
> >> >> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
> >> >> news:0A0CF647-FE4B-496B-8FE8-8D8ED9880813@microsoft.com...
> >> >> > I'm doing a web app in VB/Dot Net 2.0. I'm probably a bit rusty and
> >> >> > I
> >> >> > have
> >> >> > no experience using the repeater control.
> >> >> >
> >> >> > I have a user control I've created with multiple properties. I've
> >> >> > created
> >> >> > a
> >> >> > test page and I've managed to bind the usercontrol to a repeater and
> >> >> > display
> >> >> > some data in the following fashion:
> >> >> > <asp:Repeater ID="Repeater1" runat="server"
> >> >> > DataSourceID="ObjectDataSource1">
> >> >> > <ItemTemplate >
> >> >> > <uc1:AUserControl runat="server" SomeField='<%# Eval("SomeField")
> >> >> > %>'
> >> >> > />
> >> >> > </ItemTemplate>
> >> >> > </asp:Repeater>
> >> >> >
> >> >> > This works but I get a single line of controls down the left hand of
> >> >> > the
> >> >> > window. Also these controls are unevenly grouped by a key field.
> >> >> > In
> >> >> > other
> >> >> > words, what I would like to see is something like this, a 2
> >> >> > dimensional
> >> >> > formatting:
> >> >> >
> >> >> > AAAAAAA
> >> >> > AAA
> >> >> > BBB
> >> >> > CCCCCC
> >> >> > D
> >> >> >
> >> >> > and so on.
> >> >> >
> >> >> > Is there a way to format a repeater in this style?
> >> >> >
> >> >> > (What I would really like is something equivalent to Winform's
> >> >> > FlowLayoutPanel but I would settle for a scheme that permitted a
> >> >> > fixed
> >> >> > number
> >> >> > of controls per row.)
> >> >>
> >> >>
> >> >>
> >>
> >>
>
>