0
A
回答
0
你可以用Asp.net直放站control.Footer模板做到這一點很容易將幫助您在C#中,您將數據綁定持有總和
<FooterTemplate>
<tr style="border-top: 1px solid Grey;">
<td colspan="2">
<strong>Total</strong>
</td>
<td>
<strong></strong><asp:Label ID="CartTotal" runat="server" Text='0' /></strong>
</td>
</tr>
</table>
</FooterTemplate>
如下所示
CartListRepeater.DataSource = Yourdatasource;
CartListRepeater.DataBind();
然後在綁定數據後向Footer添加數據。
Control FooterTemplate =CartListRepeater.Controls[CartListRepeater.Controls.Count - 1].Controls[0];
Label lblFooter = FooterTemplate.FindControl("CartTotal") as Label;
lblFooter.Text = "0"//This is your total value;
希望這會幫助你。
+0
謝謝你的幫助..我的問題使用datatable排序。因爲我必須獲取數據從不同的名單,來自我的bll,使事情棘手.. 最好的問候。 – juhinah
相關問題
- 1. GridView模板幫助
- 2. GridView控件模板
- 3. 在GridView的頁眉模板
- 4. GridView模板綁定(C#UWP)
- 5. Gridview與模板字段
- 6. Gridview項目模板刷新
- 7. WPF模板和在GridView
- 8. GridView使用模板字段和頁眉模板排序
- 9. ASP.NET GridView - 編輯動態模板列
- 10. 動態更改GridView模板字段
- 11. 如何從項目模板中的GridView
- 12. 使用DataTable綁定GridView的Item模板
- 13. asp.net gridview的編輯模板編程
- 14. 標準化gridView尋呼機模板
- 15. Gridview Item模板DropDownList已啓用
- 16. 動態更改GridView項目模板
- 17. obout gridview - 使用編輯模板
- 18. gridview的foreach複選框頭模板
- 19. GridView控件模板場賽事
- 20. Gridview模板字段數據源
- 21. asp.net gridview的編輯模板http鏈接
- 22. 在Gridview中重新排列模板列
- 23. UWP - 沒有Xaml模板的GridView
- 24. Firefox是不是在GridView的模板
- 25. Boostrap模式沒有顯示ASP.NET GridView模板按鈕點擊
- 26. Modalpopupextender面板,進入gridview
- 27. MediaWiki模板模板?
- 28. C++模板模板
- 29. 模板模板類
- 30. 有模板成員 - 模板模板扣
IMO,你不能在前端做到這一點。我可以建議,使用循環迭代'GridView'並檢查是否有多個具有相同名稱的條目,並獲得後端中每個人的總數。現在忘掉總計。 –
發佈你的代碼,如果你已經嘗試過。 – AsifAli72090
您可以使用網格中的頁腳行來完成整個零件。總的來說,雖然你可能會更好地使用中繼器或甚至嵌套中繼器。你會獲得更多的靈活性。 – ADyson