Windows Develop Bookmark and Share   
 index > Windows Forms General > How to display a Dictionary in a gird like PropertyGird
 

How to display a Dictionary in a gird like PropertyGird

Hi,

At run time, I created an instance of Dictionary Object which has a few keys and values. Now I want to display it inside something look like PropertyGird, one column for keys and one for values which is editable. My problem is I don't know the keys at design time, they are dynamic variables. That's why I cannot use PropertyGrid. Any ideas or walk around?

BR,

L

Lanceli  Wednesday, January 31, 2007 7:55 PM

Hi again,

Forgot to say, I'm using C# Express SP1.

BR,

L

Lanceli  Wednesday, January 31, 2007 7:56 PM
You could dynamically create an object at run time and give it a custom property descriptor but by the time you had done all that it might not be worth the effort :-) Is there some reason you can't use a DataGridView and make it look like a property grid?
Alan Robbins  Wednesday, January 31, 2007 8:06 PM

Well, if the datagridview can appear vertically by veryfew line of code,then I will do that. The number of possible fields is above 20, as if I show it as normal datagridview, it's not very nice looking, instead the propertygrid looks brilliant. Do you have any suggestion?

/L

Lanceli  Wednesday, January 31, 2007 10:13 PM

You can use google to search for other answers

Custom Search

More Threads

• Adding Different Color Items to ComboBox or ListBox
• Setting the TabIndex
• Visible instance fields and inherited forms
• Get all control on the forms
• WebBrowser control and User Agent string
• Need icon and app name to display in taskbar
• appupdater weird problem
• Determining application version of excel instance
• Inserting a Windows Form in the shell context menu
• Progress Bar / Text and timer