Click here to Skip to main content
15,891,513 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Is there a way to make a Winform PropertyGrid work with static fields :
C#
public class Config
{
     public static string ServerName = "localhost";
}
Posted

1 solution

It is possible in normal way itself :
C#
public static string m_ServerName = "localhost";
public  string ServerName //Read and Write
{
      get { return m_ServerName; }
      set { m_ServerName = value; } 
}

public static string m_DisplayServerName = "localhost";
public string DisplayServerName //Read Only
{
     get { return m_DisplayServerName; }       
}
 
Share this answer
 
Comments
Mehdi Gholam 9-Aug-15 5:44am    
Not what I asked.
sreeyush sudhakaran 9-Aug-15 6:18am    
sorry can you please make it more clear...
Mehdi Gholam 9-Aug-15 6:24am    
I want the PropertyGrid to show static fields, as is if possible.
sreeyush sudhakaran 9-Aug-15 6:30am    
Please refer this http://www.codeproject.com/Articles/22717/Using-PropertyGrid , sorry my knowledge is limited for answering your question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900