|
Lets assume you have all keys in a string array 'keys' and als names in a string array 'names':
HashTable keysToNodesHash = new HashTable();
for (int i = 0; i < keys.Length; i++) {
TreeNodeCollection nodes = treeView1.Nodes;
if (keys[i].Length > 2)
nodes = (TreeNodeCollection)hash[keys[i].SubString(0, keys[i].Length - 2)];
TreeNode newNode = nodes.Add(names[i]);
keysToNodesHash.Add(keys[i], newNodes.Nodes);
}
Haven't tested it but it should give you the basic idea. Note that this will only function properly if the nodes come in the right order (liek in your example). If this isn't true you will have to sort them before this operation.
|
|
|
|
|
Hi all, hope you can help me with a small problem.
I need to add an item to the forms drop down menu that you get when you right click the icon in the top left of the form.
Anyone know how??
Cheers
Kev
|
|
|
|
|
Hi,
I want to install multiple instance of the windows service with different name. So for that I need to read the service name at the time of installation from some config file.
Can any buddy help me out in this?
Ankit Singhal
|
|
|
|
|
Check this out
http://www.codeproject.com/csharp/CSharpWindowsServiceInst.asp
|
|
|
|
|
How can I show custom string such as "N/A" in DataGrid instead (null) for null columns?
My datagrid data will load by a DataSource.
Or how can I filter sum record/field when loading fata from DataSource to DataGrid !?
Thank you
|
|
|
|
|
I found it ...
int nColCount = dataGrid1.DataSource.Tables[0].Columns.Count;<br />
int nStyleCount = dataGrid1.TableStyles.Count;<br />
for(int nSC= 0; nSC < nStyleCount; nSC++ )<br />
for(int nCol = 0; nCol < nColCount; nCol++ )<br />
{<br />
dataGrid1.TableStyles[nSC].GridColumnStyles[nCol].NullText = "N/A";<br />
}<br />
|
|
|
|
|
hi,
What does .net stand for? or What is the .net original name?
Thanks
|
|
|
|
|
|
|
It means DOT in the NET
- ashish
|
|
|
|
|
Now, I just recently found out about PropertyGrid and I think I like it.
My problem is, I can't figure out how to display my tree in a apropriate way.
My classes look like this:
class MyTreeNode
{
List mylist = new List();
public MyTreeNode[] SubNodes
{
get { return (MyTreeNode[])mylist.ToArray(); }
}
public string Name = "something";
}
I want this MyTreeNode class to display as a list of nodes; but instead of that [0] as a name it should display the node's Name-attribute. I would also like to set the value to something different.
I just can't figure out how to do that exactly.
please give me a hint.
so long.
|
|
|
|
|
Hi,
I don't know if this works, but what about overriding the ToString() method. This overridden method should return the name. Maybe this will display the name attribute.
Regards
Sebastian
|
|
|
|
|
|
How to drag n drop the row of datagrid.Please help!!!
|
|
|
|
|
If we use System.Data.OracleClient namespace in desktop application, do we have to have Oracle client installed on the machine/desktop to access database.
- ashish
|
|
|
|
|
Yes, version 8.1.7 or later.
Here[^] is a link to the pertinent documentation.
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
Is it possible to access Oracle Database without having Oracle client installtion?
- ashish
|
|
|
|
|
As far as I know (and speaking about Oracle, it's not very far), no, there isn't. You need the client.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
I'm having a few issues with multiple projects going to the same output folder, particularly around the locking of 3rd party asssemblies that multiple projects reference, and the fact thast it can not be copied due to it being locked in the output folder by the IDE.
The main output is a windows service, that hosts remotable objects, and as no reference exists between the service, and the objects, i need some way to copy them to the output folder, so hello Post Build Step.
Now, if i copy all the files from the specific output folder, doing a *.*, i still get the same problem with locking on the 3rd party dll, (log4Net).
If i just copy the ${target}, then i do not get the dependant files that this project requires.
What is the preferred thing to do in this situation? Manually specifying the list of all the files to copy for each project, will be quite a laborius task.
Thanks
|
|
|
|
|
You might consider placing your third party assemblies in the common folder and just leaving them there, since multiple projects will reference them anyway, then just move the ${target} assembly into the common folder post-build.
If you apply the post-build script consistently to all of the projects in the applications whose assemblies you want in the common folder, you should be okay.
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
I have this problem:
I want the "user" to be able to set properties for the forms in my application in a settings window. The problem is that i want to populate a treeview with all the forms in the application. All of theese forms has probably not been activated when the user opens the settings dialog. How can i loop trough all forms in the application and populate a treeview with them? So far i only managed get those that have been created (with the obvious "foreach(Form form in this.mdichildren)".
So if somebody could help me with this it would be appriciated.
john
|
|
|
|
|
hi guyz.How do i do this.plz help!!!
Create a client/server application for the game Hangman, using stream socket connections. The server should randomly choose a word or phrase from a text file. After connecting, the client should be allowed to begin guessing. If a client guesses incorrectly five times, the game is over. Display underscores for the letters that have not been guessed yet, and display the letters that have been guessed in the word or phrase on the client.
|
|
|
|
|
|
First - Do u have a running TCP server client code ?
Second - If so then u just need to implement a randon string choosing code at the infinite receive code in server to scan client messages and compare with the string u have ....
Come up with more info
redindian
|
|
|
|
|
I am trying to connect to a sybase database. Can someone tell me what the easiest way would be to accomplish this and where can i download sybase drivers for .net from ?
TX
|
|
|
|