How to populate the values of multiple rows to gridview div using c#
example:
| id | number |
| 1 | 8768687865 |
| 1 | 8768768764 |
| 1 | 8768768678 |
| 2 | 7687687687 |
| 3 | 8768678678 |
| 4 | 8767876878 |
| 4 | 7878787878 |
| id | number |
| 1 | 8768687865 |
| 1 | 8768768764 |
| 1 | 8768768678 |
| 2 | 7687687687 |
| 3 | 8768678678 |
| 4 | 8767876878 |
| 4 | 7878787878 |
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Munesh SharmaRank #174 · 13.9K reputationPosted Apr 22, 2014, 3:59 AM EDT
http://stackoverflow.com/questions/5464193/populate-the-values-of-multiple-rows-in-single-row-in-gridview
Farhan ShariffRank #2,004 · 725 reputationPosted Apr 22, 2014, 4:02 AM EDT
samantaRank #3,157 · 454 reputationPosted Apr 22, 2014, 4:03 AM EDT
please share some code so that i can understand easily
Farhan ShariffRank #2,004 · 725 reputationPosted Apr 22, 2014, 4:04 AM EDT
{
GridViewRow row = GridView1.Rows[rowIndex];
GridViewRow previousRow = GridView1.Rows[rowIndex + 1];
if (row.Cells[0].Text == previousRow.Cells[0].Text)
{
row.Cells[1].Text += " " + previousRow.Cells[1].Text;
previousRow.Visible = false;
}
}
http://www.codeproject.com/Articles/34337/How-to-merge-cells-with-equal-values-in-a-GridView
samantaRank #3,157 · 454 reputationPosted Apr 22, 2014, 4:08 AM EDT
Farhan ShariffRank #2,004 · 725 reputationPosted Apr 22, 2014, 4:38 AM EDT
samantaRank #3,157 · 454 reputationPosted Apr 22, 2014, 4:46 AM EDT
samantaRank #3,157 · 454 reputationPosted Apr 22, 2014, 5:10 AM EDT
i want to fetch values from database table and diaplay in gridview
Farhan ShariffRank #2,004 · 725 reputationPosted Apr 22, 2014, 5:18 AM EDT
samantaRank #3,157 · 454 reputationPosted Apr 22, 2014, 7:57 PM EDT