Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to check the child td in Datalist
    text
    copied!<p>I have a Datalist. Following is the structure of the ItemTemplate:</p> <pre><code>&lt;ItemTemplate&gt; &lt;div id="driversGrid" runat="server" style="width:3500px;" &gt; &lt;table cellpadding="0" cellspacing="0" border="0" width="3500px"&gt; &lt;tr&gt; &lt;td id="Td1" runat="server" style="visibility:hidden;"&gt; &lt;asp:Label ID="lblID" runat="server" BackColor="White" Font-Bold="true" Text='&lt;%# Eval("ID") %&gt;' /&gt;&lt;br /&gt; &lt;/td&gt; &lt;td id="title" style="width:90px;text-align:center;"&gt; &lt;asp:Label ID="lblTitle" runat="server" BackColor="White" Font-Bold="true" Text='&lt;%# Eval("Name") %&gt;' /&gt;&lt;br /&gt; &lt;/td&gt; &lt;td id="am0900" runat="server" style="width:90px;"&gt;&amp;nbsp;&lt;/td&gt; &lt;td id="am0915" runat="server" style="width:90px;"&gt;&amp;nbsp;&lt;/td&gt; &lt;td id="am0930" runat="server" style="width:90px;"&gt;&amp;nbsp;&lt;/td&gt; &lt;td id="am0945" runat="server" style="width:90px;"&gt;&amp;nbsp;&lt;/td&gt; &lt;td id="am1000" runat="server" style="width:90px;"&gt;&amp;nbsp;&lt;/td&gt; &lt;td id="am1015" runat="server" style="width:90px;"&gt;&amp;nbsp;&lt;/td&gt; &lt;td id="am1030" runat="server" style="width:90px;"&gt;&amp;nbsp;&lt;/td&gt; &lt;td id="am1045" runat="server" style="width:90px;"&gt;&amp;nbsp;&lt;/td&gt; &lt;td id="am1100" runat="server" style="width:90px;"&gt;&amp;nbsp;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; &lt;/ItemTemplate&gt; </code></pre> <p>Now, at the itemdatabound event, I fetch multiple time (data) from the database in form 10:25 AM.</p> <p>I manipulate each data and convert it to <code>am1030</code> (similar to one of the td ID in itemTemplate). Now I want to check each td in ItemTemplate and compare the <code>lblID</code> (i.e. the staff ID) to the ID in my variable and then compare the <code>tdID</code> to the manipulated data. If they match change the background color of the td.</p> <p>In short, I want to check that if the <code>lblID</code> is 3 then get the td with ID <code>am1030</code> and change the background color.</p> <p><strong>Needs to be done in C#.net.</strong></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