Click here to Skip to main content
15,888,610 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Line with different width have different lengths? Pin
Luc Pattyn17-Apr-08 2:09
sitebuilderLuc Pattyn17-Apr-08 2:09 
GeneralRe: Line with different width have different lengths? Pin
KeesVer17-Apr-08 2:46
KeesVer17-Apr-08 2:46 
GeneralReflection Doesn't Enumerate Everything Pin
Thomas Wells16-Apr-08 6:29
Thomas Wells16-Apr-08 6:29 
GeneralRe: Reflection Doesn't Enumerate Everything Pin
Rob Smiley18-Apr-08 10:47
Rob Smiley18-Apr-08 10:47 
GeneralRe: Reflection Doesn't Enumerate Everything Pin
Thomas Wells21-Apr-08 6:16
Thomas Wells21-Apr-08 6:16 
Generalneed special treeview Pin
Member 472067116-Apr-08 2:20
Member 472067116-Apr-08 2:20 
GeneralRe: need special treeview Pin
Christian Graus16-Apr-08 11:54
protectorChristian Graus16-Apr-08 11:54 
QuestionBug in ListView.Items.Insert(int,ListViewItem)? Pin
AndrewVos16-Apr-08 2:08
AndrewVos16-Apr-08 2:08 
I seem to have found a bug in ListView.Items.Insert(int,ListViewItem).

Could someone please try reproduce this? Maybe I could get a bug report submitted.
(Problem seems to occur on 2.0 and 3.5)

Steps to Reproduce:
1. Start a new project
2. Add a ListView with five items in it.
3. Label them 1 to 5 so we can see what happens.
4. Add a Button.
5. Add the following code to Button.Click:
ListViewItem item4 = this.listView1.Items[3];<br />
item4.Remove();<br />
this.listView1.Items.Insert(0, item4);



The items should be arranged like this:
4 - 1 - 2 - 3 - 5

Instead we see this:
1 - 2 - 3 - 5 - 4


Workaround:
I have found if we switch to View.Details before doing the remove/insert then everything works fine.
Replace the code in Button.Click with this:
ListViewItem item4 = this.listView1.Items[3];<br />
View oldView = this.listView1.View;<br />
this.listView1.BeginUpdate();<br />
this.listView1.View = View.Details;<br />
item4.Remove();<br />
this.listView1.Items.Insert(0, item4);<br />
this.listView1.View = oldView;<br />
this.listView1.EndUpdate();




www.wickedorange.com
www.andrewvos.com

GeneralRe: Bug in ListView.Items.Insert(int,ListViewItem)? Pin
Rob Smiley18-Apr-08 10:57
Rob Smiley18-Apr-08 10:57 
GeneralRe: Bug in ListView.Items.Insert(int,ListViewItem)? Pin
AndrewVos18-Apr-08 12:00
AndrewVos18-Apr-08 12:00 
GeneralRe: Bug in ListView.Items.Insert(int,ListViewItem)? Pin
Rob Smiley18-Apr-08 12:44
Rob Smiley18-Apr-08 12:44 
AnswerRe: Bug in ListView.Items.Insert(int,ListViewItem)? Pin
Member 421315828-Oct-11 2:40
Member 421315828-Oct-11 2:40 
QuestionHow to draw miter joined lines? Pin
KeesVer16-Apr-08 1:01
KeesVer16-Apr-08 1:01 
GeneralCrystal Reports for Visual Studio 2005 Pin
Aleemulhaq16-Apr-08 0:20
Aleemulhaq16-Apr-08 0:20 
Question.NET variable tracking package Pin
K.L.K15-Apr-08 8:35
K.L.K15-Apr-08 8:35 
GeneralRe: .NET variable tracking package Pin
Ray Cassick15-Apr-08 11:29
Ray Cassick15-Apr-08 11:29 
GeneralRe: .NET variable tracking package Pin
K.L.K15-Apr-08 14:07
K.L.K15-Apr-08 14:07 
GeneralRe: .NET variable tracking package Pin
bwilhite18-Apr-08 2:25
bwilhite18-Apr-08 2:25 
Generalgetting error while creating windows service setup Pin
VenkataRamana.Gali15-Apr-08 2:37
VenkataRamana.Gali15-Apr-08 2:37 
GeneralAbout using DLL files in projects! Pin
maryam.saboor14-Apr-08 23:40
professionalmaryam.saboor14-Apr-08 23:40 
GeneralRe: About using DLL files in projects! Pin
AndrewVos14-Apr-08 23:57
AndrewVos14-Apr-08 23:57 
GeneralRe: About using DLL files in projects! Pin
Christian Graus15-Apr-08 0:06
protectorChristian Graus15-Apr-08 0:06 
GeneralRe: About using DLL files in projects! Pin
maryam.saboor15-Apr-08 0:26
professionalmaryam.saboor15-Apr-08 0:26 
GeneralRe: About using DLL files in projects! Pin
Christian Graus15-Apr-08 0:36
protectorChristian Graus15-Apr-08 0:36 
QuestionDrawing pie with parts excluded. Pin
AndrewVos14-Apr-08 19:56
AndrewVos14-Apr-08 19:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.