Click here to Skip to main content
15,884,986 members
Articles / Programming Languages / C#

Customized Display of Collection Data in a PropertyGrid

Rate me:
Please Sign up or sign in to vote.
4.92/5 (165 votes)
30 Jun 200310 min read 1.1M   13.5K   388  
PropertyGrid is widely used to display an object's properties and values
In this article, I will explore an answer to two questions. How is it possible that an array provides its contained objects to the PropertyGrid as if they were properties? Furthermore, the names of the objects contained in the array are displayed with its sequence numbers ( [0],[1],...). The second question is how to customize so that more meaningful data is displayed instead of sequence numbers? We will also develop a solution.
Microsoft Visual Studio Solution File, Format Version 7.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomizedPropertyGridData", "CustomizedPropertyGridData.csproj", "{0C6F6F8D-120E-4FF4-AA21-BA81FC52CD62}"
EndProject
Global
	GlobalSection(SolutionConfiguration) = preSolution
		ConfigName.0 = Debug
		ConfigName.1 = Release
	EndGlobalSection
	GlobalSection(ProjectDependencies) = postSolution
	EndGlobalSection
	GlobalSection(ProjectConfiguration) = postSolution
		{0C6F6F8D-120E-4FF4-AA21-BA81FC52CD62}.Debug.ActiveCfg = Debug|.NET
		{0C6F6F8D-120E-4FF4-AA21-BA81FC52CD62}.Debug.Build.0 = Debug|.NET
		{0C6F6F8D-120E-4FF4-AA21-BA81FC52CD62}.Release.ActiveCfg = Release|.NET
		{0C6F6F8D-120E-4FF4-AA21-BA81FC52CD62}.Release.Build.0 = Release|.NET
	EndGlobalSection
	GlobalSection(ExtensibilityGlobals) = postSolution
	EndGlobalSection
	GlobalSection(ExtensibilityAddIns) = postSolution
	EndGlobalSection
EndGlobal

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


Written By
Web Developer
Germany Germany
For ten years I worked as a senior consultant, coach, lead architect and project lead for several consulting companies.
Currently I work as a system architect for Zuehlke Engineering GmbH based in Frankfurt.
You can find a detailed resume here.

Comments and Discussions