|
Let's see... not too familiar with sarcasm, aren't we?
|
|
|
|
|
|
Hi Craig,
if you need urgent help d´ont post call 911 instead!!!
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
Okay...
Personally I would create some sort of a class which contains the data I want to access.
public class MyDataTag
{
public MyDataTag(DataRowView dataRow)
{
itemID = dataRow["NodeId"];
text = dataRow["EnNode"].ToString();
otherInfo = dataRow["OtherInfo"].ToString();
}
public object itemID;
public string text;
public string otherInfo;
}
Then I would replace the tree node creation code with:
TreeNode node = new TreeNode();
MyDataTag dataTag = new MyDataTag(dv[i]);
node.Text = dataTag.text;
node.Tag = dataTag;
And your AfterSelect event handler:
MyDataNode itemData = e.Node.Tag as MyDataNode;
if (itemData != null)
{
string test = string.Format("ID: {0} Other Info: {1}", itemData.itemID.ToString(), itemData.otherInfo);
ListViewItem newItem = listView1.Items.Add(test);
newItem.Tag = itemData;
}
Lea Hayes
|
|
|
|
|
|
I have a Windows Form MDI which 3 treeviews that are separated by a Split Container.
I am trying to make them populate from the same Database but with diffrent tables for each treeview.
So far i have managed to only populate one out the three and could some help me please?
Thank you in advance
|
|
|
|
|
Just treat them as 3 treeviews, the fact they are in split containers should not be relevant. Just bind each one to the appropriate data source.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Im Sorry Im New to Programming so i dont know how to do it.
Could you please help me ?
|
|
|
|
|
After flooding the forum with no less then 4 near-identical posts, I dont think anyone is going to be in the mood to help you.
|
|
|
|
|
I second that.
"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
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
im very sorry for that.
I just wanted a little help
but thank you
|
|
|
|
|
craigMUTOKOKAI wrote:
I just wanted a little help
That's cool. Folks around here can be helpful, just be patient. Since you said you were new, I suggest you look through articles of interest on this site, and become familiar with researching on google
"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
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
I have tried to search around but no luck
so my friend told me about this website that people can help you rather you searching on google and finding nothing.
Thank You
|
|
|
|
|
craigMUTOKOKAI wrote: my friend told me about this website
What a good friend you have. Welcome aboard
"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
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Thank You.
I have been trying to this for 3 days now but still no luck.
Do you were i can find a good Example for 3 treeviews that connect to a Sql Server. Using either diffrent Database or the same database using tables inside the same database.
If that Makes any sense
If not then Thank You.
You Guys are Great
I like this Forum
|
|
|
|
|
craigMUTOKOKAI wrote: Do you were i can find a good Example for 3 treeviews that connect to a Sql Server.
You're going about this the wrong way. You're trying to find an example of using 3 treeview with SQL server. What you really have is a single treeview, which you said you already got working, and repeating the same process 3 times.
|
|
|
|
|
Oh okay thank You.
What i was trying to do is to create a class to connect to the Server.
And then use that class in the 3 treevies that i have so that they can connect to the database an populate thier own table.
Like
Treeview 1 = Golf
database table= golf
Treeview 2= tennis
database table=tennis
Treeview 3=Basketball
Database Table = Basketball
An the Database instace will be called Sports.
So i want to connect these Tables to the same Database but to use thier own tables in the database to populate the treeview.
I hope im making sense.
Can you help me create this class and call the class whithin the Treeviews.
i hope im no stressing you out.
If i am very Sorry
|
|
|
|
|
Just as I said in the first place, and Dave has repeated, just treat them as 3 individual treeviews. You have said you have 1 working, so repeat the process for each of the others. The connection to the database is the same, you are just selecting from different tables. Try reading up on datareader and dataset as these are the things you are really using.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
J4amieC wrote: After flooding the forum with no less then 4 near-identical posts, I dont think anyone is going to be in the mood to help you.
He posted it four times just to show how urgent the problem is
|
|
|
|
|
he needs lots of help
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
What im trying to do is to link the Treeview to the List view.
I have the Treeview linked to the database already and i want it so that when i click on a node it will display in the List View.
Does any one know how to do this?
If so please Answer my Question
|
|
|
|
|
Don't flood the forums with the same questions.
"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
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
What im trying to do is to link the Treeview to the List view.
I have the Treeview liked to the database already an i want it so that when i click on a node it will display in the List View.
Does any one know how to do this?
If so please Answer my Question
|
|
|
|
|
How have you attached the database to your tree view control?
You can add an event handler to the tree view to intercept when the currently selected node has changed. Then, depending on how you've got things set up, you could possibly:
#1 - Look up the required data from the database by the ID associated with a tree view node.
#2 - Extract the information from the selected tree view node.
Don't forget that you can use the 'Tag' property of tree view nodes, so you could associate your data using the Tag property. Then it is very easy to access your information. In your selected node changed event handler you can simply populate your list view from the associated 'Tag' property, or even acquire additional information from your data source using the information provided by the 'Tag' property.
I hope that I have understood you correctly, and that this is of some use.
Best regards,
Lea Hayes
|
|
|
|
|
Afternoon everyone. Crap weather we're having today...
Now then, what's going on here?
using System;
namespace Confusion
{
public delegate void ThingDelegate();
public abstract class A
{
public virtual void Thing()
{
Console.WriteLine("A::Thing");
}
}
public class B : A
{
public override void Thing()
{
Console.WriteLine("B::Thing");
ThingDelegate del = base.Thing;
del.Invoke();
}
}
public class C : A
{
public override void Thing()
{
Console.WriteLine("C::Thing");
ThingDelegate del = base.Thing;
del.BeginInvoke(null, null);
}
}
class Program
{
static void Main(string[] args)
{
B b = new B();
b.Thing();
Console.ReadLine();
C c = new C();
c.Thing();
Console.ReadLine();
}
}
}
If you run this simple console application what's the output? If you're as dim as me, you'd expect:
B::Thing
A::Thing
C::Thing
A::Thing
What you actually get is:
B::Thing
A::Thing
C::Thing
C::Thing
C::Thing
...
... to infinity and beyond.
eg. Invoke and BeginInvoke resolve to different methods. Can anyone explain why?
Regards,
Rob Philpott.
|
|
|
|