Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>Thank you AYK for your help, it Worked when I changed it this way:</p> </blockquote> <pre><code> protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e) { if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) { DataList dls1 = (DataList)sender; Label lbl = (Label)e.Item.FindControl("hiddenLable"); string idfromindex = lbl.Text; DataList lst2 = (DataList)e.Item.FindControl("innerDataLiat"); Panel pnl = (Panel)e.Item.FindControl("Panel1"); t = setinnerDataList(idfromindex); int sumqty = 0; double sumprice = 0; for (int i = 0; i &lt; t.Tables[0].Rows.Count; i++) { sumprice += Convert.ToDouble(t.Tables[0].Rows[i]["p_price"]) * Convert.ToInt32(t.Tables[0].Rows[i]["qty"]); sumqty += Convert.ToInt32(t.Tables[0].Rows[i]["qty"]); } Label lbl14 = (Label)e.Item.FindControl("Label14"); lbl14.Text = sumqty.ToString(); Label lbl15 = (Label)e.Item.FindControl("Label15"); lbl15.Text = sumprice.ToString(); lst2.DataSource = t; lst2.DataBind(); } } &lt;asp:DataList ID="innerDataLiat" runat="server" RepeatColumns="1" BackColor="#CCCCCC" CellPadding="4" CellSpacing="2" ForeColor="Black" GridLines="Both" OnItemDataBound="DataList2_ItemDataBound" &gt; &lt;FooterStyle BackColor="#CCCCCC" /&gt; &lt;HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" /&gt; &lt;ItemStyle BackColor="White" /&gt; &lt;ItemTemplate &gt; &lt;table style="width: 100%;" &gt;&lt;/table&gt; &lt;table style="width: 100%;" id="tbl1"&gt; &lt;tr&gt; &lt;td&gt; &amp;nbsp;product name: &lt;/td&gt; &lt;td&gt; &amp;nbsp;&lt;asp:Label ID="pname" runat="server" Text='&lt;%# Eval("pname") %&gt;'&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;td&gt; &amp;nbsp;quantity : &lt;/td&gt; &lt;td&gt; &amp;nbsp;&lt;asp:Label ID="qty" runat="server" Text='&lt;%# Eval("qty") %&gt;'&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;td&gt; &amp;nbsp;unit price: &lt;/td&gt; &lt;td&gt; &amp;nbsp;&lt;asp:Label ID="unit_price" runat="server" Text='&lt;%# Eval("p_price") %&gt;' &gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/ItemTemplate&gt; &lt;/asp:DataList&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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