How to update the time for any Item-ListView

Contributor
8May2007,16:45   #1
shah123's Avatar
Hi,
Code:
 private void editBtn_Click(object sender, EventArgs e)
        {
            if (scheduleListView.SelectedItems.Count > 0)
            {

                if (scheduleListView.SelectedItems[0].Selected)
                {
                  
                    scheduleListView.Items.Add(lvt);
                    scheduleListView.Update();
                    scheduleListView.Invalidate();
                }
                          
        }
}
I have hour and minute control as DomainUpDown controls and when i change the time for any of those control time should be updated in listview for that selected item. Give me any rough idea please.

Thanks
Go4Expert Founder
8May2007,17:35   #2
shabbir's Avatar
You change the text of the item sub items. How to get the item / sub items you can refer to your previous posts where I have mentioned it.
Contributor
8May2007,17:44   #3
shah123's Avatar
I didnt understood what you mean?
Go4Expert Founder
8May2007,18:17   #4
shabbir's Avatar
I thought I was clear. Update the content of the items / sub items.
Contributor
9May2007,13:42   #5
shah123's Avatar
No Shabbir brother can you be more specific please? Thanks
Contributor
9May2007,13:50   #6
shah123's Avatar
Any help. Just some more explanation that what I am doing scheduled application where I have two controls for hour and minutes as DomainUpDown Controls and i have a button as edit. Now the query is when i select any item in ListView and then change the hour and minute for that item and then click on edit which will update the starting time of that event.

Now the code for edit which i was trying to write as my last thread.
Go4Expert Founder
9May2007,14:53   #7
shabbir's Avatar
Code: CSharp
ListViewItem lvi = listView1.Items[0];
lvi.SubItems[0].Text = "Shabbir";
It will change the item 0,0 to my name.
Contributor
9May2007,14:55   #8
shah123's Avatar
It worked thanks. I got the idea of items and subitems perfectly. Thanks again Shabbit bhai
Go4Expert Founder
9May2007,15:10   #9
shabbir's Avatar
I think you should have tried the same. You are becoming lazy in trying till you get the code.
Contributor
9May2007,16:08   #10
shah123's Avatar
ahahhaa... I am not lazy com'n .. and some snippet code or algorithm just makes life easier instead of text Anyway thanks Shabbir.