In order to support Multi Object editing in Delft Shell an extended property editor called FilteredPropertyGrid has been added to the DelftShell UI.

Multi Object Editing in Visual Studio
The standard System.Windows.Forms.PropertyGrid supports editing of multiple objects by exposing a SelectedObjects property. This functionality is also found in Visual Studio 2005. In the image below you can see 3 different views of the grid when editing a form using the form editor.

figure 1 - Some sample views from the multi object property editor in Microsoft Visual Studio

PropertyGrid analyses the objects set to SelectedObjects and makes the following adjustments:

  • Show empty property value if the values of the different objects are different (See blue boxes in image)
  • Remove all properties that are not found in all selected objects (see column 2 and 3 in image)
  • It removes the Name property if more than 1 object is selected. This is probably an addition from Visual Studio.

In Visual Studio an extra combo box is added that shows all objects on the form (see green boxes). A user can also select a control via this combo box (as opposed to clicking on the form). This is almost the desired behaviour that we want in DelftShell but instead of indivual objects we want categories of objects. When editing a schematisation the collection of all individual objects is probably too large.

FilteredPropertyGrid
FilteredPropertyGrid extends the functionality of the PropertyGrid by extra support for objects of different types. The default behaviour of the PropertyGrid is to show only the common properties of the objects in the selectedObjects array. In some cases it is desirable to add an extra filter for objects types.
An example were this behaviour is requested is the 1d schematisation editor. The user selects the objects in the GIS oriented view by tracking a rectangle. The objects inside the rectangle are set as selectedObjects in a propertygrid. In many cases the objects in the selection rectangle will be of different types; this results in a very limited subset of shared properties. Typically a user is only interested in river profiles or culverts. This FilteredPropertyGrid user control automatically makes a subdivision of the different types in the selectedObjects array and offers the user the chance to make a selection via a combobox.

The combobox at the top of the FilteredPropertyGrid tries to mimic the behaviour of the combobox in Visual Studio. If 1 object is selected the Id is shown bold followed by the type description.

figure 2 - Some sample views from the multi object property editor in DelftShell and a RR schematisation. Note that this model only has object of type string or UrbanNode.

To Do/ Discussion

  • Add option to add indivual objects to the combobox like visual studio.
  • Remove the Id property if more than 1 object is selected.
  • The functionality of the original PropertyGrid class in Delft Shell (keyboard support) has not yet been copied to FilteredPropertyGrid.
  • Add a icon/symbol for each type of object in the combobox to enable the user to respond/select more quickly.

Notes:

  • This is not a replacement for the Multiple Data Editor found in Sobek. This editor uses a table to show multiple objects. This editor allows individual editing of object and multi-editing by selecting ranges in the grid. Some objects are subdivided for to keep it comprehensible (e.g. Flow - Cross Section is split in Cross Section, Friction and Initial Values) This functionality - if needed - can possibly be best implemented by using (custom generated) DataTables bound to a DataGrid.
  • No labels