I would like it to display after every duplicate ID I would like
Match:
Then the coloumns
Match:
Then the coloumns I would like it to render this based when a duplicate MatchID is spotted below is the c# code rendering the gridview
public string GetPlayersInTeam(int teamID, Hashtable HomeHsh, GridView gv, string selectedTeamName)
{
DataTable dataTable = new DataTable();
dataTable.Columns.Add("TeamID", typeof(int));
dataTable.Columns.Add("Team Name", typeof(string));
dataTable.Columns.Add("Player Name", typeof(string));
dataTable.Columns.Add("Esa Player ID", typeof(int));
//Loop through PlayerHsh to find all players within that TeamID
foreach (DictionaryEntry de in HomeHsh)
{
Player p = de.Value as Player;
int teamid = p.TeamID;
//If the players teamID matched selected team id then show in DataTable
if (teamid == teamID)
{
string playerName = p.Name;
DataRow row = dataTable.NewRow();
row["TeamID"] = teamid;
row["Team Name"] = selectedTeamName;
row["Player Name"] = playerName;
dataTable.Rows.Add(row);
gv.DataSource = dataTable;
gv.DataBind();
}
}
Not entirely sure what you are trying to do. Am I getting it straight that you want to display the players of a team, but only when the other team in the same match is also in the list?
Superguppie.
Please remember to click “Mark as Answer” on the post that helps you. This can be beneficial to other community members reading the thread.
When all you've got is a Hammer, Every Problem looks like a Nail. Michael Swain.
luke_bryant
Member
396 Points
361 Posts
Grdiview Select and formatting
May 18, 2012 11:26 AM|LINK
Hi Programmers,
I have a gridview displayed below but as you can see it holds matches
luke_bryant
Member
396 Points
361 Posts
Re: Grdiview Select and formatting
May 18, 2012 11:28 AM|LINK
I would like it to display after every duplicate ID I would like
Match:
Then the coloumns
Match:
Then the coloumns I would like it to render this based when a duplicate MatchID is spotted below is the c# code rendering the gridview
public string GetPlayersInTeam(int teamID, Hashtable HomeHsh, GridView gv, string selectedTeamName) { DataTable dataTable = new DataTable(); dataTable.Columns.Add("TeamID", typeof(int)); dataTable.Columns.Add("Team Name", typeof(string)); dataTable.Columns.Add("Player Name", typeof(string)); dataTable.Columns.Add("Esa Player ID", typeof(int)); //Loop through PlayerHsh to find all players within that TeamID foreach (DictionaryEntry de in HomeHsh) { Player p = de.Value as Player; int teamid = p.TeamID; //If the players teamID matched selected team id then show in DataTable if (teamid == teamID) { string playerName = p.Name; DataRow row = dataTable.NewRow(); row["TeamID"] = teamid; row["Team Name"] = selectedTeamName; row["Player Name"] = playerName; dataTable.Rows.Add(row); gv.DataSource = dataTable; gv.DataBind(); } }superguppie
All-Star
48225 Points
8679 Posts
Re: Grdiview Select and formatting
May 21, 2012 01:31 PM|LINK
Not entirely sure what you are trying to do. Am I getting it straight that you want to display the players of a team, but only when the other team in the same match is also in the list?
Please remember to click “Mark as Answer” on the post that helps you. This can be beneficial to other community members reading the thread.
When all you've got is a Hammer, Every Problem looks like a Nail. Michael Swain.
Qin Dian Tan...
All-Star
113532 Points
12480 Posts
Microsoft
Re: Grdiview Select and formatting
May 25, 2012 01:17 AM|LINK
Hi,
Try this for grouping data in GridView with sub header: http://www.agrinei.com/gridviewhelper/gridviewhelper_en.htm
Thanks,
If you have any feedback about my replies, please contactmsdnmg@microsoft.com.
Microsoft One Code Framework