How to update the time for any Item-ListView

shah123's Avatar
Contributor
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
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
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.
0
shah123's Avatar
Contributor
I didnt understood what you mean?
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
I thought I was clear. Update the content of the items / sub items.
0
shah123's Avatar
Contributor
No Shabbir brother can you be more specific please? Thanks
0
shah123's Avatar
Contributor
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.
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Code: CSharp
ListViewItem lvi = listView1.Items[0];
lvi.SubItems[0].Text = "Shabbir";
It will change the item 0,0 to my name.
0
shah123's Avatar
Contributor
It worked thanks. I got the idea of items and subitems perfectly. Thanks again Shabbit bhai
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
I think you should have tried the same. You are becoming lazy in trying till you get the code.
0
shah123's Avatar
Contributor
ahahhaa... I am not lazy com'n .. and some snippet code or algorithm just makes life easier instead of text Anyway thanks Shabbir.