Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You should prefer repeaters to other more complex ASP.net controls unless there is something from say a listview or gridview that you will need.</p> <p>To create rows where there is no match - Start with a list of dates/times and bind your repeater to this. By the looks of things you want a repeater for the Role headings, and a repeater for each column in the table. i.e:</p> <pre><code>&lt;tr&gt; &lt;td&gt;Date&lt;/td&gt; &lt;asp:Repeater runat="server" id="rptHeadings"&gt; &lt;td&gt;&lt;%# Eval("Role") %&gt; &lt;/asp:Repeater&gt; &lt;/tr&gt; &lt;asp:Repeater runat="server" id="rptDateTimes" OnItemDataBound="rptDateTimes_DataBound"&gt; &lt;tr&gt; &lt;td&gt;&lt;%# Eval("Date") %&gt; &lt;asp:Repeater runat="server" id="rptTasks" OnItemDataBound="rptTasks_DataBound"&gt; &lt;td&gt; &lt;asp:Literal runat="server" id="litTask" /&gt; &lt;/td&gt; &lt;/asp:Repeater&gt; &lt;/tr&gt; &lt;/asp:Repeater&gt; </code></pre> <p>And then in your codebehind - handle the rptDateTimes_DataBound event to bind your rptTasks repeater, and handle the rptTasks_DataBound event to populate the Text property of litTask - if there is a task then set the text otherwise leave it blank. Example:</p> <pre><code>protected void rptTasks_DataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType != ListItemType.Item &amp;&amp; e.Item.ItemType != ListItemType.AlternatingItem) return; if (/* logic to determine if task is done At given date by given role */) { litTask.Name = SomeTask.Name; } } </code></pre>
 

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