Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I'm not sure what you're asking, but why not just put a complete row in the ItemTemplate and AlternatingItemTemplate, like this:</p> <pre><code>&lt;ItemTemplate&gt; &lt;tr style="vertical-align:top;"&gt; &lt;td class="bnotes" style="width:325px;padding:5px;"&gt; &lt;%# XPath("title")%&gt;&lt;br /&gt; &lt;%# XPath("description")%&gt;&lt;br /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/ItemTemplate&gt; &lt;AlternatingItemTemplate&gt; &lt;tr style="vertical-align:top;"&gt; &lt;td class="bnotes" style="width:325px;padding:5px;"&gt; &lt;%# XPath("title")%&gt;&lt;br /&gt; &lt;%# XPath("description")%&gt;&lt;br /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/AlternatingItemTemplate&gt; </code></pre> <p>That way you don't have to figure it out yourself - just let the control render itself.</p> <p><strong>EDITED TO ADD</strong></p> <p>Looking at your posted code again, it looks like you might have been attempting one row of alternating cell styles. I think you misunderstood the intent of the ItemTemplate and AlternatingItemTemplates; they usually deal with the fields (columns) of a given record.</p> <p>In this case, you'd have the first RSS feed item in an ItemTemplate, then the second RSS feed item in an AlternateItemTemplate (i.e., another row), then the third RSS feed item in an ItemTemplate and so on.</p> <p>I hope this helps - if I've misunderstood what you're trying to do let me know.</p> <p><strong>2nd Edit</strong></p> <p>Based on the example layout posted in the comments, I think the <a href="http://msdn.microsoft.com/en-us/library/7efxhktc.aspx" rel="nofollow">DataList Class</a> would be a better option, as you can easily specify multiple columns (using the <code>RepeatColumns</code> property). Something like this:</p> <pre><code>&lt;asp:XmlDataSource ID="SomeFeed" DataFile="TestSomeRSS.xml" XPath="rss/channel/item" runat="server"&gt; &lt;/asp:XmlDataSource&gt; &lt;asp:DataList ID="SomeFeedScroller" DataSourceID="SomeFeed" RepeatColumns="2" RepeatDirection="Horizontal" RepeatLayout="Table" runat="server"&gt; &lt;ItemStyle CssClass="bnotes" Vertical-Align="top" Width="325px" /&gt; &lt;AlternatingItemStyle CssClass="bnotes" vertical-Align="top" Width="325px" /&gt; &lt;ItemTemplate&gt; &lt;%# XPath("title")%&gt;&lt;br /&gt; &lt;%# XPath("description")%&gt; &lt;/ItemTemplate&gt; &lt;AlternatingItemTemplate&gt; &lt;%# XPath("title")%&gt;&lt;br /&gt; &lt;%# XPath("description")%&gt; &lt;/AlternatingItemTemplate&gt; &lt;/asp:DataList&gt; </code></pre> <p>The above is not tested, but the general idea was to keep the formatting as close to what was in the ListView as possible.</p> <p>Another possible approach might be something similar to this thread on having multiple columns in a Repeater control: <a href="http://forums.asp.net/t/1090192.aspx/1" rel="nofollow">Multiple columns in a repeater</a>.</p> <p>The DataList control supports editing, selecting, updating, etc like ListView. The Repeater control does not.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload