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

Home Posts Topics Members FAQ

ListView and File renaming

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 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) ;
}
catch
{
}
}
----------


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

MikeY

Nov 17 '05 #1
1 3801
test
"MikeY" <mi*******@yaho .com> wrote in message
news:fz******** ***********@new s20.bellglobal. com...
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 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) ;
}
catch
{
}
}
----------


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

MikeY

Nov 17 '05 #2

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

Similar topics

0
1977
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...
6
4653
by: VM | last post by:
How can I fill up a listview with text file contents? My listview has two columns and the first column fills up with a while loop: while (myString != null) { myString = sr.Readline(); listView1.Items.Add (myString); } Is there a way I can fill up the second column this easily? Thw way I'm currently doing it is using the subitems property to add it. Unfortunately,
0
2337
by: willow1480 | last post by:
I am developing a small little Service Control Application. I am using a listview control with checkboxes and getting the list of services I want to control from a text file. When you check a checkbox, it should either stop the service or start the service depending on each respective service's status. I want the listView to update the status for each service as they are checked. instead all I can seem to do is clear the listView and I...
3
9305
by: MikeY | last post by:
Hopefully someone can help me on this. I am using C#, making Windows forms. I have created a listView with checkbox's. I have enabled the checkboxes under the properties, and all the data, checkbox's and icons are displayed as they are meant to be. My problem is this, I am trying to achieve the same results as I get with CheckListBox(s), where I am able to select (Check-mark) various checkboxs items and able to alter the data. I do...
2
2964
by: MikeY | last post by:
Hi all, I am coding window forms in C#. My problem is this: I have created a "Check ListView" or a 'ListView' with checkbox's. I have populated the it with my files from my folders, mps, txt, etc. The ListView is in Details, with headers and an Icon. What I am trying to accomplish is to rename/append check mark file massively (at once). This is accomplished by the user inputting a name into a provided
0
2239
by: Chris Putnam | last post by:
I am working on an application that includes a feature where a directory is spidered and thumbnails are displayed. I have it pretty much down, but when the bitmaps are loaded from file, memory is hogged like crazy. I know this is where the memory problems occur because I've gone through that whole comment/check the ram thing. Here's the source of where the problem occurs: Public Shared Sub FillImageList(ByVal dir As String, ByVal...
0
2627
by: George | last post by:
This is driving me crazy. I have a listview that has LabelEdit set to true. In the AfterLabelEdit event, I do my validation on the label text. If the label isn't valid, it sets e.canceledit = true and calls the BeginEdit event. I have included below the entire event handler code again as shown at the end of this post. Assume for this scenario that the label edited to an invalid value After editing the value, if the user tabs away from...
1
4487
by: Ole Nielsby | last post by:
I want listview label editing by hitting the F2 key, just like when renaming a file in Explorer. However there seems to be no method or property to programmatically enter Label Edit mode. Is this not supported or did I miss a trick?
36
5391
by: Don | last post by:
I wrote an app that alerts a user who attempts to open a file that the file is currently in use. It works fine except when the file is opened by Notepad. If a text file is opened, most computers are configured to use Notepad to open the file by default and if they are configured to use Notepad by default I want it to remain that way rather than retrieve the text into my app or force the user to use another app to read the file. I'm...
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...
0
9170
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
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
5943
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
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...
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.