Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Excel functionality in listview
 

Excel functionality in listview

Hi

I have a listview control on my windows form. I have an insert button on the form and I am giving user an option to insert an item above or below the selected item. How can i provide this functionality to user.


Regards,Adeel Arshad
khushi83  Wednesday, July 01, 2009 8:51 AM
Hi khushi83,

ListView is not suitable to accomplish such task, you'd better think of DataGridView. It has more function to operate data(Insert/update/delete etc.). You can use Insert method of the DataGridViewRowCollection.
http://msdn.microsoft.com/en-us/library/s80x2556.aspx
For example:
dataGridView1.Rows.Insert(0, new DataGridViewRow());
new DataGridViewRow() is a new instance of a row, you can define it before this line of code.

Sincerely,
Kira Qian
Please mark the replies as answers if they help and unmark if they don't.
Kira Qian  Friday, July 03, 2009 2:57 AM
Hi khushi83,

ListView is not suitable to accomplish such task, you'd better think of DataGridView. It has more function to operate data(Insert/update/delete etc.). You can use Insert method of the DataGridViewRowCollection.
http://msdn.microsoft.com/en-us/library/s80x2556.aspx
For example:
dataGridView1.Rows.Insert(0, new DataGridViewRow());
new DataGridViewRow() is a new instance of a row, you can define it before this line of code.

Sincerely,
Kira Qian
Please mark the replies as answers if they help and unmark if they don't.
Kira Qian  Friday, July 03, 2009 2:57 AM

You can use google to search for other answers

Custom Search

More Threads

• Child controls are not removed from Controls Collection from within IComponentChangeService event handlers
• PictureBox - Transparent - Expected behaviour?
• refresh() method
• Unspecified error - in Form Designer of Visual C# 2008 Express
• Scrolling Custom Control/Component
• Outlook Address Card View
• Dates between...
• Customizing Binding Navigator
• Lost Event Enter -> Tab When I am using AutoCompleteSource !
• Error-Bug BindingSource in Designer :DataSource gives System.OutOfMemoryException