Click here to Skip to main content
15,908,264 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello please help me to solve this problem.....

I am going to create a billing software.At the sales form i need to create a listview and within the listview i need to add textboxes to add item details....So plz help me.......
Posted

Do you mean to create something like excel? And create column with cells?

If so, add a listview to your designer, go to Properties->View and set it to "Details". Then go to columns to add new columns.

Here is a article to help: http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.aspx
 
Share this answer
 
Comments
aneesh kumar k 30-Jul-10 0:42am    
thanks for ur reply...
But
I need to add Texboxes and button to the listview for the sales page in the billing software for the sales details like entering the item name, qty,tax etc....and after completion then next line will appear for the next addition of items

(Click to enlarge)

Do you mean something like that? If so, then the MSDN article I provided above is sufficient. Just look at the example code provided. It shows you all the ins and outs of the list view by adding items through the code.

Try dragging a list view onto your designer and put in the code (from the ListView MSDN Article: http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.aspx)
C#
// Create three items and three sets of subitems for each item.
			ListViewItem item1 = new ListViewItem("item1",0);
			// Place a check mark next to the item.
			item1.Checked = true;
			item1.SubItems.Add("1");
			item1.SubItems.Add("2");
			item1.SubItems.Add("3");
			ListViewItem item2 = new ListViewItem("item2",1);
			item2.SubItems.Add("4");
			item2.SubItems.Add("5");
			item2.SubItems.Add("6");
			ListViewItem item3 = new ListViewItem("item3",0);
			// Place a check mark next to the item.
			item3.Checked = true;
			item3.SubItems.Add("7");
			item3.SubItems.Add("8");
			item3.SubItems.Add("9");

			// Create columns for the items and subitems.
			// Width of -2 indicates auto-size.
			listView1.Columns.Add("Item Column", -2, HorizontalAlignment.Left);
			listView1.Columns.Add("Column 2", -2, HorizontalAlignment.Left);
			listView1.Columns.Add("Column 3", -2, HorizontalAlignment.Left);
			listView1.Columns.Add("Column 4", -2, HorizontalAlignment.Center);

			//Add the items to the ListView.
            		listView1.Items.AddRange(new ListViewItem[]{item1,item2,item3});
 
Share this answer
 
v3
So What a problem in doing this....?
Just Drag the LIST VIEW in to your form and then drag the controls over it....
It is possible just go through it.
Shweta:rose:
 
Share this answer
 
It would be better you use DataGridView instead of listview
 
Share this answer
 
Dear friend,

As per your requirement gridview is the best control to use not listview.

:)

Regards
Manuj Sharma
 
Share this answer
 
thanks for ur reply... But I need to add Texboxes and button to the listview for the sales page in the billing software for the sales details like entering the item name, qty,tax etc....and after completion then next line will appear for the next addition of items - aneesh kumar k 24 secs ago
 
Share this answer
 
Comments
Toli Cuturicu 30-Jul-10 6:09am    
Reason for my vote of 1
fake answer
Mike$7 30-Jul-10 14:06pm    
Have you read any of the previous comments?
aneesh kumar k 30-Jul-10 23:28pm    
yes i got the answer by using datagridview...it is more simple

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