Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Datalist Control alternative layout...

Datalist Control alternative layout...

Scheduled Pinned Locked Moved Web Development
csstutorialquestion
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    markymark82
    wrote on last edited by
    #1

    hey all, Don't know whether this is possible or not so thought I'd put it out there as I can't seem to find an answer through google... I need to create an online advent calendar, this is easy enough in itself, I'm filling up a Datalist in a grid, enough said..... Except... The MD of the company (not a technical person) wants the layout to be less grid like. She wants it to flow more, for example, top row would contain 3 windows, next would be 4, then 3, then 4 etc. Can this be done in one datalist? The cells would need to be staggered (like brickwork). I thought about using flow mode but it always ends up as a grid at the moment. Do I need to use multiple datalists/repeaters (1 per row)? I'm happy to have it as a grid, but then I also want to deliver the best I can. Any suggestions would be greatly appreciated, even if its just pointers in a vaguely right direction. Cheers in advance... Mark

    N 1 Reply Last reply
    0
    • M markymark82

      hey all, Don't know whether this is possible or not so thought I'd put it out there as I can't seem to find an answer through google... I need to create an online advent calendar, this is easy enough in itself, I'm filling up a Datalist in a grid, enough said..... Except... The MD of the company (not a technical person) wants the layout to be less grid like. She wants it to flow more, for example, top row would contain 3 windows, next would be 4, then 3, then 4 etc. Can this be done in one datalist? The cells would need to be staggered (like brickwork). I thought about using flow mode but it always ends up as a grid at the moment. Do I need to use multiple datalists/repeaters (1 per row)? I'm happy to have it as a grid, but then I also want to deliver the best I can. Any suggestions would be greatly appreciated, even if its just pointers in a vaguely right direction. Cheers in advance... Mark

      N Offline
      N Offline
      NeverHeardOfMe
      wrote on last edited by
      #2

      Oh you'll have fun with that! I suggest the approach to take may be to keep flow layout and capture the ItemDataBound event, inserting
      tags after every third (on odd rows) or every fourth (on even rows) item... probably need a couple of static counters to track row and item counts... then centre the whole thing in a div... be a bit tricky, but should be possible...

      M 1 Reply Last reply
      0
      • N NeverHeardOfMe

        Oh you'll have fun with that! I suggest the approach to take may be to keep flow layout and capture the ItemDataBound event, inserting
        tags after every third (on odd rows) or every fourth (on even rows) item... probably need a couple of static counters to track row and item counts... then centre the whole thing in a div... be a bit tricky, but should be possible...

        M Offline
        M Offline
        markymark82
        wrote on last edited by
        #3

        hmmm... Thought it might be something like that, was just hoping :) for something a bit more simple I suppose. The annoying thing is that there's no RowDataBound Event for a datalist or repeater. How hard would it be to create a custome Datalist control with a rowdatabound event? that way I could change the number of columns based on alternating rows? (at least, that's how it looks in my head, I'm sure it would probably never work like that...) Cheers for the response I'll look into it. As time is tight then I guess they'll just get what I can fit in. Thanks again Mark

        N 1 Reply Last reply
        0
        • M markymark82

          hmmm... Thought it might be something like that, was just hoping :) for something a bit more simple I suppose. The annoying thing is that there's no RowDataBound Event for a datalist or repeater. How hard would it be to create a custome Datalist control with a rowdatabound event? that way I could change the number of columns based on alternating rows? (at least, that's how it looks in my head, I'm sure it would probably never work like that...) Cheers for the response I'll look into it. As time is tight then I guess they'll just get what I can fit in. Thanks again Mark

          N Offline
          N Offline
          NeverHeardOfMe
          wrote on last edited by
          #4

          markymark82 wrote:

          How hard would it be to create a custome Datalist control with a rowdatabound event?

          Write it, let us know and write an article about it! :-) Of course, being an Advent Calendar, I presume the numbner of items is fixed.... in which case you could just use a sort of brute force approach and dispense with teh datalist altogether and just bind your data directly to 25 (or whatever) labels (oe whatever)... at least then you could have total control over the layout... or, as you suggested, separate datalists for each row. Bit inelegant, but as longa sit woreks. Your real problems only arise if the number of items isn't fixed...

          M 1 Reply Last reply
          0
          • N NeverHeardOfMe

            markymark82 wrote:

            How hard would it be to create a custome Datalist control with a rowdatabound event?

            Write it, let us know and write an article about it! :-) Of course, being an Advent Calendar, I presume the numbner of items is fixed.... in which case you could just use a sort of brute force approach and dispense with teh datalist altogether and just bind your data directly to 25 (or whatever) labels (oe whatever)... at least then you could have total control over the layout... or, as you suggested, separate datalists for each row. Bit inelegant, but as longa sit woreks. Your real problems only arise if the number of items isn't fixed...

            M Offline
            M Offline
            markymark82
            wrote on last edited by
            #5

            Phil Uribe wrote:

            markymark82 wrote: How hard would it be to create a custome Datalist control with a rowdatabound event? Write it, let us know and write an article about it!

            Ask a stupid question I suppose... Well maybe I will, but first... How do you create Custom Server Controls :) Unless of course someone has pitty after reading this and decides that they could do a better job than I ever could and writes an article in time for me to use it by christmas! Will probably go down the brute force route as time is short and my list of work is long. Thanks for all the pointers, I'll be sure to make good use of them.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups