Click here to Skip to main content
15,911,890 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
Purchasefecade facade = new Purchasefecade();
List<purchaseentity> entityList = facade.GetPurchase(Convert.ToString(TxtpurNo.Text.Trim()));
if (entityList != null && entityList.Count > 0)
{
   foreach (PurchaseEntity entity1 in entityList)
   {
      dgv.Rows.Add(new object[] { 
         entity1.ProductId, entity1.PRoductName, entity1.Packing, entity1.BatchNo,
         entity1.PurPrice, entity1.Qty, entity1.Free, entity1.Margin, 
         entity1.ExpiryDate, entity1.ExDuty, entity1.AdTax, entity1.CSTAmnt, 
         entity1.PVatPer, entity1.SalesDiscPer, entity1.SalesPrice, entity1.BatchId,
         entity1.DiscPersentage, entity1.SVatPer, entity1.MRP, entity1.PurChaseId});
   }
}

here
how to display above values in datagrid rows
like
C#
datagrid.Rows[i].Cells[0]=entity1.ProductId;

am not getting please help me..
Posted
Updated 31-Dec-13 3:40am
v5

1 solution

It's simple try following code

C++
Gridview.DataSource = your entitiy list object 
Gridview.DataBind()


Hope my solution will work for you
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900