Adding items at bottom in List View
-
Hi, In the list view i've couple of temporary items and they are staying at the bottom of the list, when i do sorting i dont want to include those two rows how to do that? Thanks
-
Hi, In the list view i've couple of temporary items and they are staying at the bottom of the list, when i do sorting i dont want to include those two rows how to do that? Thanks
Only way I know is to remove them, sort the list and then add them again, unless you inherit from the list view and provide your own custom enumeration.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones
-
Hi, In the list view i've couple of temporary items and they are staying at the bottom of the list, when i do sorting i dont want to include those two rows how to do that? Thanks
BalajiRamasamy wrote:
Adding items at bottom in List View
Hi there, Try this, maybe you could like use it on a Button click event or something...: int i = listView1.Items.Count; listView1.Items.Add("NEW-ITEM", i++); -------- First, we define an Integer (i) and assign it the value of the total amount of items in the listView1 control, then we add an item at the bottom of the list by incrementing the total item amount by 1. Hope this helps regards, jase
-
BalajiRamasamy wrote:
Adding items at bottom in List View
Hi there, Try this, maybe you could like use it on a Button click event or something...: int i = listView1.Items.Count; listView1.Items.Add("NEW-ITEM", i++); -------- First, we define an Integer (i) and assign it the value of the total amount of items in the listView1 control, then we add an item at the bottom of the list by incrementing the total item amount by 1. Hope this helps regards, jase
I did exactly the same, but after sorting what ever i add it automatically gets sorted and placed at the top, it is not listening me
-
Hi, In the list view i've couple of temporary items and they are staying at the bottom of the list, when i do sorting i dont want to include those two rows how to do that? Thanks
Something like this: this.listView1.Clear(); this.listView1.Items.Add("Item 2"); this.listView1.Items.Add("Item 1"); this.listView1.Sorting = SortOrder.Ascending; this.listView1.Sort(); this.listView1.Sorting = SortOrder.None; this.listView1.Items.Add("Temp1"); this.listView1.Items.Add("Temp2");