Datalist Control alternative layout...
-
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
-
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
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... -
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...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
-
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
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...
-
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...
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.