|
Thanks for your attempt, I knew how to handle it in .NET2.0 but I want to do the same in .NET1.1, the requirement demanded so. I have to use Requirefieldvalidator not Custo,Validator.
Thanks
|
|
|
|
|
I'm making a Music Library and I'm using the DataGridView class to hold the songs. Each song used TagLib# to change it's attributes (Title, Artist, etc). Each song (the class), extends DataGridViewRow. The song class has a DataGridViewTextBoxCell for the main attributes. I want it to when the value of the text box is changes, an event is fired and the attribute is updated. But I can find the proper event in the DataGridViewTextBoxCell or DataGridViewRow instances. I found that DataGridViewRow has a private method titled "RaiseCellValueChanged", but I can't find the associated event.
BTW this forum doesn't seem to like Linux. I can't make threads on my Kubuntu Laptop. After I click "Post Message" nothing happens and Firefox times out.
|
|
|
|
|
Jordanwb wrote: BTW this forum doesn't seem to like Linux. I can't make threads on my Kubuntu Laptop. After I click "Post Message" nothing happens and Firefox times out.
Strange. I sometimes post for *nix with no problem at all. Used both Firefox and Konqueror...
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hmm strange too because I had no problem posting this in Kubuntu.
|
|
|
|
|
Hi,
there is a DataGridView.CellValueChanged event. Doesn't that suit your purposes?
|
|
|
|
|
Yes it does. I never checked there because I was expecting the event to exist in the Row or the Cell.
|
|
|
|
|
Hello C# people! =)
i have a question for this simple piece of code:
using System;<br />
using System.Collections.Generic;<br />
using System.ComponentModel;<br />
using System.Data;<br />
using System.Drawing;<br />
using System.Text;<br />
using System.Windows.Forms;<br />
<br />
private void helpToolStripMenuItem_Click(object sender, EventArgs e)<br />
{<br />
MessageBox.Show("Hello, world.");<br />
}<br />
Now is my question:
I cant get the Pop up to work... =)
|
|
|
|
|
Hi,
make sure the event is wired to the handler you wrote.
Either look using Designer, or inspect the Designer-generated code (it would be in some
xxx.designer.cs file within your project).
|
|
|
|
|
Sounds like an event handler isn't triggering it. Like Luc said, take a look around and see if the reference to it is missing.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I am writing a program that takes all the files from one folder, EXCEPT the one created today, and copies them to another folder. Everything works ok except copying only the files that were created prior to today. Instead my program copies all of the files over.
The part that is highlighted is the part I can't get to work. When the console writes out the creation time it is always of the time the files are being created currently and not when they were created orginally
if (Directory.Exists(target.FullName) == false)
{
Directory.CreateDirectory(target.FullName);
}
foreach (FileInfo fi in source.GetFiles())
{
if (fi.CreationTime != DateTime.Today)
{
Console.WriteLine("Creation Time: {0}", fi.CreationTime);
Console.WriteLine(@"Copying {0}\{1}", target.FullName, fi.Name);
fi.CopyTo(Path.Combine(target.ToString(), fi.Name), true);
}
}
foreach (FileInfo fi in source.GetFiles())
{
Console.WriteLine(@"Deleting {0}\{1}", source.FullName, fi.Name);
fi.Delete();
}
|
|
|
|
|
Hi,
fi.CreationTime contains date and time information,
whereas DateTime.Today is a DateTime whose Time part is set to 00:00:00
You need to use fi.CreationTime.Date which also gives a DateTime with zero time.
FWIW: DateTime.Today == DateTime.Now.Date
|
|
|
|
|
Thanks for the response. When I try this it only works if I have the operator set to == but I want it to be != because I don't want it to copy the current file. Also, when the console writes out the date it is always todays date. This isn't right because it should be the date of when the file was created. If it is always set to the current date then none of the files will be copied.
foreach (FileInfo fi in source.GetFiles())
{
if (fi.CreationTime.Date != DateTime.Now.Date) {
Console.WriteLine("Creation Time: {0}", fi.CreationTime);
Console.WriteLine(@"Copying {0}\{1}", target.FullName, fi.Name);
fi.CopyTo(Path.Combine(target.ToString(), fi.Name), true);
}
}
|
|
|
|
|
Hi,
The code you have shown seems right.
Make sure you don't confuse creation time and modification time, Windows Explorer can be
told to show one or the other (or both).
BTW:
- if you write to an existing file, even when replacing all the content, that will not
modify the creation date.
- if you copy a file, the new file may or may not get its creation time set to now, depending
on how you do it.
Finally, I tend to show and use a file's modification time most of the time, since that better
tracks the file's content.
|
|
|
|
|
It looks like you're absolutley right. It's giving me the creation time which is today, but I want the last modified property. How do you get that to show inside the code?
I really appreciate all your help!!
I think I may have figured it out. Do you use the lastWriteTime property?
|
|
|
|
|
FileInfo has some 15 properties, the one you need is in the documentation;
scan the list, you will spot it even if it has a somewhat peculiar name.
|
|
|
|
|
THANKS!!
It it LastWriteTime. You were very helpful and I appreciate the time you took to help me.
|
|
|
|
|
You're welcome.
|
|
|
|
|
Hi every ONE
i am working in a current project in the final process ( Crystal Reports )
there is a table that each user have more than one and more rows
i want to make a report like this view
- User_ID
row1: - Colm1 - Colm2
- Colm---------3
row2: - Colm1 - Colm2
- Colm---------3
i am using C# .net , please any one help me as soon as posible ..... URGENT
|
|
|
|
|
Ahmed EL Gendy wrote: help me as soon as posible ..... URGENT
That is considered very rude and likely won't get you any help on this site.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hey
on vb we use Handles to handle code with many controls ,
Now one C# I want to handle a code with some textboxes keydown event
then what can I do ..
I feel that vb is more easy in coding than c#
jooooo
|
|
|
|
|
Hi,
try simply adding the same event handler to several text boxes using properties window in designer.
For furher study, investigate the generated designer.cs code. With a little effort you get the idea what happens at code level.
Hope this get's you going.
Mika
|
|
|
|
|
thanks my friend and i will check it now
jooooo
|
|
|
|
|
You're welcome.
Mika
|
|
|
|
|
Hi,
if you have the same event handler for several Controls (either through Designer, or by code),
then the event handler can figure out which Control fired the event by looking at the first
parameter object sender .
Say e.g. all Controls firing this event are Buttons, then simply do
Button btn=(Button)sender; and you are holding the Button that fired the event.
You may want to be more defensive and use the as instead of a straight cast though.
|
|
|
|
|
thanks my friend
you are right to use
sender
now I'm checking it and thanks for really kinds friends here
jooooo
|
|
|
|