|
Dear Friends,
I have expereinced a weird problem related
to C# ListView control sorting.
In my Form's constructor i have added
some list view items , then sort it ascendig oredr an dthen i tried to select
the first item in the listview and expect that it will select the first item in
the sorted list.
But surprisingly it selects the first item
added to the list view !
But when i move the item selection cod eto
Form.Load event handler or Form.Activated event handler it is working as
expected !
Is this any bug or already documented
somewhere in MSDN?
Here is the code snippet.
public
Form1()
{ //
// Required for Windows Form Designer support // InitializeComponent();
......................
......................
listView1.ListViewItemSorter
= new ListViewItemComparer(0,SortOrder.Ascending);
this.listView1.Items.Add("India");
this.listView1.Items.Add("France"); this.listView1.Items.Add("America"); this.listView1.Items.Add("Russia"); this.listView1.Items.Add("Japan");
listView1.Sort();
//This doesn't select the item "America" but selects the item "India"
// If we move this
to Form.Load or Form.Activated event handler it selects teh item "America".
listView1.Items[0].Selected = true;
}
Any idea ?
Regards,
Aboobacker
YAHOO! GROUPS LINKS
|
- [Microsofts_C_Sharp] faq's on .net p_srinivasarao_1999
- Re: [Microsofts_C_Sharp] faq's on .net Chris Cottrell
- [Microsofts_C_Sharp] C# List View Sorting Iss... BABU ABOOBACKER
- Re: [Microsofts_C_Sharp] C# List View Sor... Chris Cottrell
- Re: [Microsofts_C_Sharp] C# List View... Babu Aboobacker
- Re: [Microsofts_C_Sharp] C# List... Chris Cottrell
- Re: [Microsofts_C_Sharp] C# ... Babu Aboobacker
- Re: [Microsofts_C_Sharp]... Chris Cottrell
- Re: [Microsofts_C_Sharp] faq's on .net Ganesh Yella
- Re: [Microsofts_C_Sharp] faq's on .net Chris Cottrell
- RE: [Microsofts_C_Sharp] faq's on .ne... Stephen Russell
- Re: [Microsofts_C_Sharp] faq's on .net asd asd
