473,714 Members | 2,527 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Renaming files and ListView display

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 handler to rename file:
----------
private void lvIndivFileConv ersion_AfterLab elEdit(object sender,
System.Windows. Forms.LabelEdit EventArgs e)
{
try
{
File.Move(Path. Combine(current FolderPath,
this.lvIndivFil eConversion.Foc usedItem.Text),
Path.Combine(cu rrentFolderPath , e.Label.ToStrin g()));
DisplayInfo(cur rentFolderPath) ; //To call folder cycle through
and redisplay
}
catch
{
}
}
----------


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

MikeY


Aug 24 '05 #1
0 1977

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2808
by: andrewcw | last post by:
I have a simple winform with the following code. But although I can read back the info, the display fails to provide the text or the cell background color changes. private void ListViewBroke() { listView.View = View.Details; ArrayList LVcolTitles= new ArrayList(); LVcolTitles.Add("Drive"); LVcolTitles.Add("Cust");
1
3447
by: newbie | last post by:
Hello, I maybe asking too much in a single posting, but here it goes: I building a windows form that mimic's the Outlook XP GUI. Its a three pane form that will allow a user to view and edit records in a database. A Treeview in the left pane, a Listview in the TopRight Pane, and a PropertyGrid in the BottomRight; The Treeview will allow the user to select an "Entity" to view, the listview will display a list of instances of
1
3801
by: MikeY | last post by:
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...
1
5675
by: Mamatha | last post by:
Hi I have one application ,that diplays data from database into the listview control.While adding data to the listview i want to display an icon to the leftside of the first column's data.Here is my code, but icon is not apperead with that code. Source code
0
293
by: MikeY | last post by:
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...
2
6725
by: Lars Erik Nes | last post by:
Hi all. I have a problem. I get all my data from a dataset (not mssql) and in that dataset i have a table called "Activity". In this table i have a few date fields. When i display the dataset "Activity" in a listview the date fields is displayed like : dd.mm.yy 00:00:00. How can i format this date. I do not want the time. Just the date. In my dataset "activity" all date fields are formatted as: dd.mm.yyyy. Why do i get the 00:00:00 ??...
4
6091
by: gene kelley | last post by:
I had a VB6 app that used a third party ListView control to simply display various recordsets. The control had a VirtualMode which I used for this display. Now in VB2005, I want to do the same with the native ListView to display various datasets in VirtualMode. I have a ListView with the VirtualListSize set and the appropriate columns in place which is all similar to the old VB6 app. However, the similarities end there as I can't find...
0
1523
spider1916
by: spider1916 | last post by:
hi there, i need some help on hou to add multiple files selected in an ShowOpen dialog box to my listview. i am using my listview to display all the attached files for an email. i can add a single file at a time but need to add multiple files too. pls help.
1
1340
by: mridulmurari | last post by:
Hey. I need help with a certain problem I'm facing in VB6. I need to display the contents of multiple items in a listview. The situation is this : Everytime i double-click on an item in a listview, a form containing a richtextbox or a dynamically created dialogue box should display the contents of the file. The problem is that i'm not able to view multiple files at the same time. So, is it possible to display a single form containing a...
0
8796
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8704
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9307
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
6627
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4462
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4715
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3155
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2514
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2105
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.