Sukesh Marla
Sukesh Marla

Reputation:

Extension Properties

HI, I Am creating one user Control in windows Application which contain Treeview With n Nodes
The NUmbe OF Nodes Will be decided At Runtime.
I Want To Store Some Data On Each TreeNode Which I Can Retrieve When TreeNode Get Selected.
Problem is that some node will store custid,custname..
some store studid,studname,,,,,,

I Have used Extension Methods
static class Extension
{
static Dictionary m_Dictionary=new Dictionary();
public static void SetTags(this TreeNode p_TreeNode, Dictionary p_Dictionary)
{
m_Dictionary = p_Dictionary;
}
public static Dictionary GetTags(this TreeNode p_TreeNode)
{
return m_Dictionary;
}
}
but it will not help becase iam getting data on the last node only...
how i can achieve this ..
is there is something like etension properties....or whether there is any other solution.
Thank In Advance,,,,,,,

Upvotes: 0

Views: 359

Answers (2)

Prashant Cholachagudda
Prashant Cholachagudda

Reputation: 13090

There is nothing called etension properties exist, if you want add simple string data to tree nodes use Tag property.

Upvotes: 1

Mehrdad Afshari
Mehrdad Afshari

Reputation: 422222

No, there's no such thing as of C# 3.0.

Look at this: https://stackoverflow.com/questions/138367/most-wanted-feature-for-c-4-0

Upvotes: 0

Related Questions