|
Hi All
the problem is this that i m filling the treeview from the XML File when the form load event occurs the treeview starts making its nodes and child nodes . when I add a node to the XML file it is added but the tree doesnt show it again restarting the application displays the node newly added. I tried the refresh method but I think the problem is this that xmltextreader is forward reader of xml file when the new node is added the cursor is not there which avoids the treenode to make itself updated how to get rid of this problem
SAS
|
|
|
|
|
You have to refresh you TreeView manually by reloading the Xml file. One way to check if the Xml file has been modified is to get the hash code of file, last modified attribute, or store the size in bytes in a long. Then make a timer to check if the values has changed let's say every minute. If there are changes clear all the nodes and reload them again like you did in the load event.
Regards
|
|
|
|
|
Nader Elshehabi wrote: One way to check if the Xml file has been modified is to get the hash code of file, last modified attribute, or store the size in bytes in a long. Then make a timer to check if the values has changed let's say every minute.
Or simply use a FileSystemWatcher component and handle the Changed event
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
I don't know why I go the hard way.
Thanks Stefan. Nice catch.
Regards
|
|
|
|
|
Don't think doubleposting will solve your problems.
Best regards!
-Larantz-
|
|
|
|
|
A small addition to the things Nader told you: A simple way to be notified of changes on your XML file is to use a FileSystemWatcher component and handle the Changed event.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi, I Would like to know how do i read an Excel Document from C#
La Light
|
|
|
|
|
Depending on the version of Excel, you can control Excel via COM, or via .NET. But, you can't read it, on a machine that doesn't have Excel installed, unless it's Office 2007, using the new file format, in which case, the document is a zip that contains XML.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Well, this will only work if your Excel file simply contains Data, no Macros.
Instead of saving as an Excel (*.xls) file, save it as a Tab-Delimited Text File (*.txt)
Then just use a StreamReader to read it as plain text.
|
|
|
|
|
Hi All
My application (C#, Framework 1.1) running in the background. I am displaying a form in every five minutes. This form has only a hyperlink control. To show myForm I am using
myForm.ShowDialog();
When this form is displayed, it grabs the focus, and I loose the focus if I am working in another application, say, MS-Word. My form has the following properties set.
myForm.TopMost = false;
myForm.FormBorderStyle = FormBorderStyle.None;
How can prevent this from happening?
Can anybody help me on this?
Thanks
Muthu.
|
|
|
|
|
|
Hi,
My issue is I want to show the form..I don't want to hide it. When I am showing that form..it should not get any focus. The work being done in other applications should not be interrupted.
Thanks
Muthu.
|
|
|
|
|
Why are you using ShowDialog() instead of Show() ?
ShowDialog() makes the form the top window for that application (as with modal
dialogs, the onces you can not ignore inside an application),
whereas Show() is used normally for forms and for modeless dialogs (the ones you
can leave open but still allow you to operate other windows).
Luc Pattyn
|
|
|
|
|
Because I am calling ShowDialog() in a Thread. If I use Show(), it gives a weird look, and controls in the second form not diplayed and grayed.
Thanks
Muthu.
|
|
|
|
|
When I insert a char in textBox, the program will fall because that variable inserted in the textBox must to be integer.
How to fix this.
Vasildb
|
|
|
|
|
Vasildb wrote: the program will fall because that variable inserted in the textBox must to be integer.
I don't understand what you mean by that. You can use the TextBox.Text property to set its text to a string .
/ravi
|
|
|
|
|
The text inserted in the textBox must be integer. But if I enter something else............. Problem.
Vasildb
|
|
|
|
|
So do you mean you want to prevent the user from entering anything but integers into the TextBox ? If so, you may want to use a MaskedTextBox [^].
/ravi
|
|
|
|
|
Yes. But how to do that, because I have Visual Studio 2003.
Help.
Vasildb
|
|
|
|
|
See this[^] article.
/ravi
|
|
|
|
|
Hi
How to Track the delivery Status of email.i am sending emails from System.Net.Mail in C#.NET.i want know weather email sent or Bounced or any error While Sending email.I code it in Try Catch block,if no error i am assuming that mail was deliverd else disply error message from Catch Block.
Thanks for any help.
TRK
|
|
|
|
|
TRK@UK wrote: if no error i am assuming that mail was deliverd
Not really. That just means your client application was able to successfully request the SMTP server to deliver the message.
/ravi
|
|
|
|
|
You can not get any delivery status for a mail when you send it, as it is not delivered directly to the recipient. You only know if it got delivered to your outgoing mail server.
You can never ever be certain if a mail was delivered or not. The closest you can get is if you include a request for a receipt in the mail, then the receiving mail program may attempt to send a receipt back to you when the user opens it.
If the mail could not be delivered, the mail server may attempt to send an error report to the mail address that you supplied as sender. In some cases, for example if the mail was filtered out as spam, it will not send any error report.
---
Year happy = new Year(2007);
|
|
|
|
|
Guffa wrote: You can never ever be certain if a mail was delivered or not. The closest you can get is if you include a request for a receipt in the mail, then the receiving mail program may attempt to send a receipt back to you when the user opens it.
Actually you can get a bit closer than that if you're sending html email, the recipient's client displays images, and you have a webserver. Embed a link to an image on your webserver with a unique identifier in the URL, if the image is ever accessed the email was displayed.
--
Rules of thumb should not be taken for the whole hand.
|
|
|
|
|
dan neely wrote: Actually you can get a bit closer than that if you're sending html email, the recipient's client displays images, and you have a webserver. Embed a link to an image on your webserver with a unique identifier in the URL, if the image is ever accessed the email was displayed.
That is an alternative, but I'm not certain that it is any closer. The recipient may choose not to display images in mails, just as s/he can choose not to send any receipt.
---
Year happy = new Year(2007);
|
|
|
|