Click here to Skip to main content
15,923,051 members
Home / Discussions / C#
   

C#

 
GeneralRe: ComboBox SelectedItemChanged event Pin
paulb4-Jul-02 13:16
paulb4-Jul-02 13:16 
GeneralListView remove item problem!! Help please Pin
Brandon Parker3-Jul-02 12:19
Brandon Parker3-Jul-02 12:19 
GeneralRe: ListView remove item problem!! Help please Pin
Orion Buttigieg3-Jul-02 12:44
Orion Buttigieg3-Jul-02 12:44 
GeneralRe: ListView remove item problem!! Help please Pin
Brandon Parker3-Jul-02 13:00
Brandon Parker3-Jul-02 13:00 
GeneralRe: ListView remove item problem!! Help please Pin
James T. Johnson3-Jul-02 14:35
James T. Johnson3-Jul-02 14:35 
GeneralRe: ListView remove item problem!! Help please Pin
Brandon Parker3-Jul-02 15:00
Brandon Parker3-Jul-02 15:00 
GeneralListView Control Pin
Orion Buttigieg3-Jul-02 11:32
Orion Buttigieg3-Jul-02 11:32 
GeneralRe: ListView Control Pin
Brandon Parker3-Jul-02 12:10
Brandon Parker3-Jul-02 12:10 
look at your code. If you use SelectedItems property to get an index value for your listview, and no item is selected there wont be a value in SelectedItems[0], thats why it crashes.

// Add a new item and at subcolumn
int index = Items.Count;
ListViewItem item = new ListViewItem("Column Text,index)
item.SubItems.Add("Subcolumn Text");
Items.Add(item);

// Add only a subitem to an existing item
listView.Items[index].SubItems.Add("subcolumn Text");

you can show a blue line by first adding the item to the row then use the controls SelectedItem property to select the index of the new item. You might also want to make sure that fullrowselect is set to true.

Brandon Parker
GeneralRe: ListView Control Pin
Orion Buttigieg3-Jul-02 12:30
Orion Buttigieg3-Jul-02 12:30 
GeneralRe: ListView Control Pin
Brandon Parker3-Jul-02 12:50
Brandon Parker3-Jul-02 12:50 
GeneralRe: ListView Control Pin
Orion Buttigieg3-Jul-02 13:00
Orion Buttigieg3-Jul-02 13:00 
GeneralQOYesterday Pin
Mazdak3-Jul-02 8:55
Mazdak3-Jul-02 8:55 
GeneralRe: QOYesterday Pin
SimonS3-Jul-02 21:55
SimonS3-Jul-02 21:55 
GeneralNeed easy way to write plugin Pin
leppie3-Jul-02 7:49
leppie3-Jul-02 7:49 
GeneralRe: Need easy way to write plugin Pin
James T. Johnson3-Jul-02 9:52
James T. Johnson3-Jul-02 9:52 
GeneralRe: Need easy way to write plugin Pin
leppie3-Jul-02 10:39
leppie3-Jul-02 10:39 
GeneralRe: Need easy way to write plugin Pin
James T. Johnson3-Jul-02 22:33
James T. Johnson3-Jul-02 22:33 
GeneralRe: Need easy way to write plugin Pin
leppie4-Jul-02 0:16
leppie4-Jul-02 0:16 
GeneralRe: Need easy way to write plugin Pin
leppie4-Jul-02 2:19
leppie4-Jul-02 2:19 
GeneralRe: Need easy way to write plugin Pin
James T. Johnson4-Jul-02 4:20
James T. Johnson4-Jul-02 4:20 
GeneralRe: Need easy way to write plugin Pin
leppie4-Jul-02 5:54
leppie4-Jul-02 5:54 
GeneralRe: Need easy way to write plugin Pin
leppie4-Jul-02 10:41
leppie4-Jul-02 10:41 
GeneralRe: Need easy way to write plugin Pin
James T. Johnson4-Jul-02 14:46
James T. Johnson4-Jul-02 14:46 
GeneralRe: Need easy way to write plugin Pin
leppie4-Jul-02 20:22
leppie4-Jul-02 20:22 
GeneralRe: Need easy way to write plugin Pin
leppie5-Jul-02 3:13
leppie5-Jul-02 3:13 

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.