I have a DataList, which is set to Horizontal Flow which renders a set of checkboxes. I also have a drop down list, which I would like to be rendered at the end of the datalist, on the same line as the last time in the datalist.
Is it possible to get rid of the last line break at the end of the datalist so the dropdown does not render on the line below the datalist?
[] i1 [] i2 [] i3 [] i4
[] i5 [] i6 DropDownList
I’m afraid not. The rendering code for the RepeatInfo (which is used to render the DataList) explicitly writes a line break when a layout it set to horizontal flow and an item is on a column boundary or the last in the list. Here that part of code:
I suppose you could try to inject the drop down list into a control collection when an item is created or bound, but then you’d have to know that it a last one. This requires knowing total count upfront, before you do the data bind.