# Introduction

# What is Smart PropertyGrid.Net?

Smart PropertyGrid.Net (SPG) is a complete, user-friendly and flexible replacement for Microsoft PropertyGrid. It provides a complete framework based on a solid object design. Microsoft PropertyGrid (MSPG) is available in various integrated development environments, e.g. Visual Studio. It has great potential for use in client applications, but was designed as a developer tool, rather than for end-users. Rather than modify the base PropertyGrid class or write a generic grid class and adapt it to the “PropertyGrid philosophy”, VisualHint decided to create a specialized and flexible framework from scratch. The result is Smart PropertyGrid.Net.

Good to know

This product has greatly evolved over the years since it has been created when .Net 1.1 was the only option. This makes Smart PropertyGrid.Net a very mature product and the first in its category.

# Features

Smart PropertyGrid.Net definitively supersedes MSPG in any client application.

  • Built with the end-user in mind, e.g. supports checkboxes for booleans (with or without text), rather than a combobox.
  • Flexible approaches to populating the grid ranging from the legacy SelectedObject(s) through to new Append and Insert calls.
  • Inplace editors appear in the Property value column, rather than as dropdowns. These include checkboxes, radiobuttons, up/down buttons, trackbars, progress bars, color editors, and many more.
  • Dynamic modification of Properties. Expand, disable and hide Properties at will. Change fonts and colors. Set possible values and read-only state at runtime.
  • Easy porting of code from the MSPG to SPG, which is globally compatible with its predecessor. For example, in both SPG and MSPG, TypeConverter, ICustomTypeDescriptor, and UITypeEditor classes return Property information.
  • Customizable appearance. The whole grid and each individual property can be made to match your application.
  • Sort Properties and validate their values as required, without displaying annoying popups.

New feature in 4.0

There is now a fluent API to configure the grid for a specific type of instance assigned to SelectedObject.

# Requirements

Smart PropertyGrid.Net is a library written in C# and can be used with any other language of the .Net development platform.

You need:

  • .Net version 6 or greater (another product exists for .Net Framework).
  • Visual Studio 2022.

# Installation

Smart PropertyGrid.Net is supplied as a simple NuGet package whose trial can be downloaded from nuget.org (opens new window). If you purchased it, then you can get it from a private NuGet feed whose url is viewable in your customer dashboard (opens new window). Here is how to proceed:

  • Remove the trial version from your solution if any.
  • Visit your dashboard to get your private NuGet feed address.
  • Open Visual Studio 2022, go to Tools -> Options -> NuGet Package Manager -> Package Sources.
  • Create a new source. Name it the way you want and set the source to your private url.
  • If you get an error when browsing the NuGet feed, open the AppData/Roaming/NuGet/NuGet.config file and check that there is no protocol attribute for this feed. If there is one which is equal to v3, remove the attribute. Save the file and restart Visual Studio.

Note

This feed is only valid for you while you have a valid subscription to support and updates.

Once you have included it in your solution, you will be able to drag the grid from the VS toolbox to your container (a form for instance) or instantiate it directly in your code.

The contained assembly first runs as a trial during 30 days. To use it after this period, you must purchase a license (opens new window) on the VisualHint web site, which will give you a license file. Here is then how to unlock the product:

  1. To use the grid inside the designer, select it and display its properties. Select the LicenseFile property and set its value to the license file. This step will be needed only once on a particular machine.

  2. To use the grid at runtime, place the license file in your solution as an embedded resource. Then, in your code, call before any PropertyGrid instantiation:

PropertyGrid.LocateLicenseInThisAssembly();

Note that some sample codes can be found on Github (opens new window).

# Redistribution

The SmartPropertyGrid.dll assembly must only be distributed with your application in an obfuscated form.

A pre-built obfuscated assembly can be found in the “distrib” folder.

It is not allowed to modify the sources, recompile and distribute the modified assembly. If you wish to do so, please contact VisualHint for assistance.

Warning

Don’t forget that the license file must not be redistributed.

# Conventions used in this manual

Convention Description
"Property"/"property" The words property and properties are used in two ways. Upper case "P": Physical row in the PropertyGrid (This is the same convention as used in writing for the Property class). Lower case "p": C# property with its get and set accessor.
Italics Indicates variables, classes, methods and properties inside the body of the text.
"SPG" Smart PropertyGrid.Net
"MSPG" Microsoft PropertyGrid
Code When a method or property is called without any variable in front, the callee is assumed to be an instance of the PropertyGrid class.
Last Updated: 5/25/2022, 1:18:09 PM