|
oldChild loses its parent as soon as I make the first call to PutSetting. I added a breakpoint to "XmlNode newChild", and all three PutSetting lines, the first breakpoint of PutSettings (breaks after XmlNode newChild is defined), oldChild still has its parent value, the second breakpoint of PutSettings (breaks after the first PutSettings line is called), and oldChild loses its parent.
So something with this line:
PutSetting("Groups/" + xmlNode.Name + "/" + newNode + "/Name", bladeName);
causes oldChild to lose its parent.
After trying your suggestion of assigning variables of the values in oldChild first, then deleting it before assigning the new node, and it seems to work fine, my XML after running it is:
<settings>
<Groups>
<Group2>
<Blade5>
<Name>Blade 5</Name>
<User>k</User>
<Host>7</Host>
</Blade5>
</Group2>
</Groups>
</settings>
Which is what I expected from the beginning. Still not sure why the PutSettings function causes a node that isn't even touched (oldChild) to lose its parent. Maybe its because it adds another child node to Group2, or more likely because it calls xmlDocument.save, which somehow causes oldChild to lose its parent (because now xmlNode and/or oldChild are no longer the latest value contained in xmlDocument?).
Meh, oh well......I don't like adding variables where I don't really need them, but it works fine for what I'm doing and they're only temporary anyway.
|
|
|
|
|
I am trying to add text to an existing pdf. I know that I can use a paragraph, phrase, or chunk, but I want to be able to specify a location on the pdf. I haven't been able to find any examples on how to do this. I'm trying to add a timestamp to the bottom of the first page when the new pdf is created.
|
|
|
|
|
|
|
On C#.net 2010 new in asp.net and desktop applications, I am suppose to have a 'type ahead' feature. Basically a user 'starts' to type a 'company name' in a text box, and then the application comes up with options on what the user is trying to enter. This way the user does not have to enter the entire company.
I do not know what this option occurs in C#.net 2010. Can you explain this to me and/or point me to a url that would explain this option to me?
|
|
|
|
|
googling Autocomplete textbox would yield a lot, including this[^]. HTH.
|
|
|
|
|
In a desktop application you can just set the AutoCompleteMode of the TextBox and then set the AutoCompleteSource to Custom and then set up the AutoCompleteCustom collection.
There is an ASP.Net AJAX control that will allow you to do this in ASP.Net: click[^]
|
|
|
|
|
Hello,
My aim is to show an animated loading icon beside the dropdownbox. When dropdownbox performs a postback the icon should appear and when it gets loaded completely, the icon should disappear. How can I succeed it in client side instead of in server side.
Would you please let me know how I can accomplish this.
Thanks.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
The easiest would be to display an animated gif[^] and then hid it once the load is completed. That way you will never need to worry about the animation, just that it is visible or not.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
First download animated gif:
- http://www.preloaders.net/[^]
- http://www.ajaxload.info/[^]
html:
<div id="divLoader" style="display:none;"><img alt="loading..." src="/images/loader.gif"/></div>
<asp:DropDownList ID="DropDownList1" runat="server" onclick="ShowHideLoader($('#divLoader'));">
</asp:DropDownList>
javascript/jQuery:
function ShowHideLoader( divLoader )
{
if($( divLoader ).is(':visible'))
$( divLoader ).hide();
else
$( divLoader ).show();
}
Hope that helps,
Morgs
|
|
|
|
|
This seems to be only a partial answer; how do you hide it again when the server acknowledges the postback? I'm not really sure how the ASP.net partial postback actually works, and although it's obviously using AJAX underneath, whether there is somewhere you can hang a JS event handler from that will tell you when the response comes back.
|
|
|
|
|
Hi there,
I made the function clever enough to do one of the possible two things.
I call the function "ShowHide" meaning it can show or hide the animated gif.
The function checks if the gif is visible and hides it otherwise shows it.
So, just call the same function to show or hide it, safe and sound.
Goodluck,
Morgs
|
|
|
|
|
Yes, but you only show how to call it on postback, not on postback response.
|
|
|
|
|
Hi,
I have a treeview with one root node. This node has some children.
The root not is a "TreeViewItemViewModel". This class contains : "ObservableCollection<TreeViewItemViewModel> Items" which are Children nodes.
At beginning, the root node is not expanded and "Children" is empty.
When I expand root node, I load data from DataBase in Children collection :
public override void LoadChildren()
{
this.Items.Clear();
List<Operation> lstOp = DataBAse.GetAllOperations();
foreach (Operation op in lstOp)
{
this.Items.Add(new TreeViewItemViewModel(op));
}
}
If I "unexpand" and expand the root node, I reload children...
public bool IsExpanded
{
get
{
return _isExpanded;
}
set
{
if (value != this._isExpanded)
{
this._isExpanded = value;
RaisePropertyChanged("IsExpanded");
if (this._isExpanded)
{
this.LoadChildren();
}
}
}
}
My issue : when I call "LoadChildren", Items list is cleared but viewmodel are always in memory...
Can someone help me ?
|
|
|
|
|
Of course the VM is in memory. It's the active object - that's what the this. reference indicates - it's the current instance. I'm not sure what you are expecting here.
|
|
|
|
|
My guess is that he refers to the TreeviewItemViewModels he adds to this.Items. That said, I still do not understand what he actually means with they being in memory. They will be garbage collected by the GC when no more references exists and when a the GC is triggered.
|
|
|
|
|
Gotcha. It was the singular of ViewModel that threw me there.
|
|
|
|
|
There are two possible reasons for this:
- They have been dereferenced, but the GC hasn't got around to picking them up yet. If your machine is not running short on memory, the .Net GC is very relaxed about bothering to reclaim unused memory. There's not much you can do about this, but you can put a button on your form that calls GC.Collect for memory checking purposes only and see if the view models get collected (you can give them a destructor that echoes to the console, again for debugging only, to find out).
- You're saving a reference to those view models somewhere. The obvious place is the tree view itself – are you putting a reference to the view model (or to a view class which is tied to the view model) into the Tag property of tree nodes which you never clear? Is the database loading process attaching event handlers which keep references to the view models alive?
|
|
|
|
|
Hi ,
I am good at C# concepts, but i am looking gaining expertise on C# programming
(developing tools e.t.c)
Can any of you please share some links, which contains good basic programs and projects.
Thanks in advance.
Regards,
Anil kumar
|
|
|
|
|
It really depends on what you want to learn in C# or what you master in C#, but as a starting point here are some links, you can explore :
1. C# - By Examples[^]
2. C# - Pizza guys sample project[^]
3. Some more sample projects with source code[^]
This is a very generalised list. If you can come up with some more specific concept viz. Threading in C#, MVC using C#, Design Pattens using C# etc. then, I think, I can provide better links on that.
Hope this helps.
All the best.
I quit being afraid when my first venture failed and the sky didn't fall down.
|
|
|
|
|
|
|
Ask a question once.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
Hi ,
I am good at C# concepts, but i am looking gaining expertise on C# programming
(developing tools e.t.c)
Can any of you please share some links, which contains good basic programs and projects.
Thanks in advance.
Regards,
Anil kumar
|
|
|
|
|
Hi,
you can edit a post using the "Edit" widget at its bottom.
you can also delete a message of yours (with the "Delete" widget next to "Edit"), as long as no reply has been posted.
So now is the time to remove the other message, and maybe edit the remaining one ...
|
|
|
|