Last post Dec 29, 2015 05:53 AM by oned_gk
Dec 22, 2015 10:54 PM|nardiM|LINK
Hello everybody! I am an asp.net junior and i am trying to build a simple livescore website. I have my database containing time, homeTeam, awayTeam, result, competition where this match is being played ect. I have to show the competition as a header text
and the belonging matches under it. As you know, there are different competitions within a day and every competition should have it's matches under it. What would be the best solution to this?
Thanks in advance!
Dec 23, 2015 01:59 AM|Candice Zhou|LINK
Welcome to ASP.NET Forums!
You could use Eval in the HeaderTemplate, like below:
<asp:Label ID="lblHeader" runat="server" Text='<%# Eval("competition") %>'></asp:Label>
Dec 26, 2015 07:52 PM|nardiM|LINK
Thank you for your quick response but i still find it difficult. I should display multiple match details under the header text of competition. It will be something like this:
Match 1: Time | Team x | result | Team y
I have these columns in my database: Id, date&time, competition, homeTeam, awayTeam, HT result, FT result.
Dec 29, 2015 05:37 AM|Candice Zhou|LINK
I think you could use DataList and have Gridview inside, please refer to this tutorial:
Dec 29, 2015 05:53 AM|oned_gk|LINK
I agree with Candice Zhou solution, you can use nested gridview or other data control like listview, datalist etc
First populate parent control with competition
SELECT DISTINCT COMPETITION FROM YOURTABLENAME
then populate child grid by this query.
SELECT * FROM YOURTABLENAME WHERE COMPETITION = @COMPETiTION