Data Entry in GridView Control
-
Hi I am creating an Windows Application (C# Visual studio 2005) for Billing System in that i want to enter the fields(Product name,price,unit price, total) in GridView Control.... Please guide me how to enter the data in Gridview control Thanks in advance
-
Hi I am creating an Windows Application (C# Visual studio 2005) for Billing System in that i want to enter the fields(Product name,price,unit price, total) in GridView Control.... Please guide me how to enter the data in Gridview control Thanks in advance
Show the grid view with one blank row and then add one by one row if user press enter key in last one column of last row For validation use onEdit and OnEndEdit events...
Best Regards, Chetan Patel
-
Hi I am creating an Windows Application (C# Visual studio 2005) for Billing System in that i want to enter the fields(Product name,price,unit price, total) in GridView Control.... Please guide me how to enter the data in Gridview control Thanks in advance
Do you mean you want to bind the grid to some datasource? If this is the case, then get the source of the data and bind to the grid. e.g. Say I have a datatable(dtBilling) as my datasource and my gridview name is dgBilling.
DataTable dtBilling = new DataTable();
dtBilling.Columns.Add("Product Name");
dtBilling.Columns.Add("Price");
dtBilling.Columns.Add("Unit Price");
dtBilling.Columns.Add("Total");dtBilling.Rows.Add("Prod1", "100", "2.50", "250"); dtBilling.Rows.Add("Prod1", "200", "3.50", "3250"); dtBilling.Rows.Add("Prod1", "300", "4.50", "450"); dtBilling.Rows.Add("Prod1", "400", "5.50", "550"); if (dtBilling.Rows.Count > 0) { dgBilling.DataSource = dtBilling; }
Hope this helps. But to be honest, the question does not seem to be very clear to me. Please let me know placidly, if you are looking a solution for this kind of problem or different! :)
Niladri Biswas