1.å æ¯ï¼
C#ä¸çDataGridViewæ§ä»¶ä½¿ç¨åºé:No row can be added to a DataGridView control that does not have columns
2.åæ¥å°±å¯ä»¥æ£å¸¸æ¾ç¤ºæ°æ®äºï¼
ç¸å ³ä»£ç ï¼
//DataGridView init
dgvSearchResult.ColumnCount = 13;
//dgvSearchResult.Rows.Add();
//(1)title
dgvSearchResult.Columns[0].HeaderText = "Title";
//(2)seller rating ( based on 1-100% format )
dgvSearchResult.Columns[1].HeaderText = "Seller Rating";
//(3)estimated delivery ( based on 24 hours - 7days format )
dgvSearchResult.Columns[2].HeaderText = "Estimated Delivery";
//(4)gig rating ( based on 1-100% )
dgvSearchResult.Columns[3].HeaderText = "Gig Rating";
//(5)orders in que ( based on 0-9999 format )
dgvSearchResult.Columns[4].HeaderText = "Orders in Queue";
//(6)level of the seller ( 1-3 )
dgvSearchResult.Columns[5].HeaderText = "Seller Level";
//(7)haz video ( yes or no )
dgvSearchResult.Columns[6].HeaderText = "Has Video";
//(8)express gigs (yes or no )
dgvSearchResult.Columns[7].HeaderText = "Is Express Gig";
//(9)country flag ( display county flag )
dgvSearchResult.Columns[8].HeaderText = "Country Flag";
//(10)+ve reviews and -ve reviews ( based on 1-9999 )
dgvSearchResult.Columns[9].HeaderText = "Positive Reviews";
dgvSearchResult.Columns[10].HeaderText = "Negative Reviews";
//(11)top rated seller ( yes or no )
dgvSearchResult.Columns[11].HeaderText = "Is Top Rated Seller";
//(12)gig url
dgvSearchResult.Columns[12].HeaderText = "Gig Url";
å
dgvSearchResult.Rows.Add(
singleGigInfo.title,
singleGigInfo.sellerRating,
singleGigInfo.estimatedDelivery,
singleGigInfo.gigRating,
singleGigInfo.ordersInQueue,
singleGigInfo.sellerLevel,
singleGigInfo.hasVideo,
singleGigInfo.isExpressGig,
singleGigInfo.coutryFlag,
singleGigInfo.positiveReviews,
singleGigInfo.negativeReviews,
singleGigInfo.isTopRatedSeller,
singleGigInfo.gigUrl);