Click here to Skip to main content
15,903,385 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Sir I require to Create a New Row in DataGridView with a DropDownList of Items.
After selecting a Item Rate should be filled from Item Master .
After that when I input the Quantity , Amount should be calculated automatically.
Also a new row should be generated automatically or by Button Press.

When Save the Button the list of Items with
Quantity 
and
Amount
should insert into a table.

Select Items    Items	       Rate	Quantity  Amount
DropDownList	INJ Charges IM	30	2	    60
DropDownList	X-RAY	        250	1	    250
DropDownList				
		                Total Amount 	    310
				
Save				
Posted
v2

1 solution

You should provide your code so you can be understood better.

If your DataGridView is DataBound, you can add the new row to the data source, and then call the DataGridView.Refresh() method.

If it's not data bound, you add it manually using DataGridView.Rows.Add() method.
 
Share this answer
 
Comments
LebneizTech 10-Apr-13 9:08am    
Presently I have no any Idea in Windows, but I can work on Web.
My DataGridView is not DataBound. I want to add manually on Run Time.
Neven Iliev 10-Apr-13 9:18am    
I assume you have a button or some other control that you click to add a new row in the DataGridView. You need to use the DataGridView.Rows.Add() method in the code-behind of that file. Keep in mind this method has several overloads, pick the one that's best for you.

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