ListView and File renaming

M

MikeY

Hopefully someone can help,

I have a listview box where I display my desired files. I single click on
the desired file to be renamed and I rename it with a new name. My problem
arises when the new name gets displayed through refreshing of my loop and
display function. The problem is that when, if I rename the last file entry,
everything appears to display fine. If I rename a file above the last entry
(bottom entry), two of the new file names appear and the last file entry
gets pushed out of the listview or disappears. After renaming, with in my
folder where the files reside, the file names are exactly as they should be
and the rename files are displaying the new names. The problem is just
within the displaying them.

Following is a sample of my code:
----------
private void lvIndivFileConversion_AfterLabelEdit(object sender,
System.Windows.Forms.LabelEditEventArgs e)
{
try
{
File.Move(Path.Combine(currentFolderPath,
this.lvIndivFileConversion.FocusedItem.Text),
Path.Combine(currentFolderPath, e.Label.ToString()));
DisplayInfo(currentFolderPath);
}
catch
{
}
}
----------




I am coding in C#. Any and all help is appreciated

MikeY
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top