A few months ago, I posted Code posted! Entities List View Control for XrmToolbox, the first iteration of some shared components for building XrmToolbox plugins. Since then, I’ve been working on a new plugin or two that provided some incentive to clean up some minor issues and add a few features to the Entities List View control.  While I was at it, I took a bit of time and created a new shared control that we often see, the Entities Dropdown control.

Entities List View control updates!

The changes for the control focused on some minor cleanup and exposing a few helper methods and properties, such as the current sort order and column in the grid. This is handy if you want to save some settings and load them later. The following properties and methods are now available on the control:

  • ListSortOrder property – the current Sort Order applied to the ListView control
  • ListSortColumn property – the current Column Index of the sorted column
  • ListFilterString property – the filter string applied to the ListView control
  • EntityRequestFilters property – a list of EntityFilter items passed to the RetrieveAllEntitiesRequest. This allows return of additional Entity information on the retrieve such as the Attribute metadata for each Entity. This is handy but it could cause the load to take some time!
  • SortEntitiesList method – Once the list is loaded, sort the Entity ListView
  • CheckEntities method – Once loaded, check the specified Entities in the ListView

While working out these new items, I also did a bit of minor cleanup. The sorting should now be more consistent and on load of the ListView, the columns should auto resize to the column contents.  I still have a bit of work that I want to do with how the Entities list is retrieved, so I hope to have a few more options in a later update.

An Entities Dropdown control!!

TWO exclamation points!!  So this one is not the most exciting control in the world but I do see a variation of it in several other XrmToolbox plug-ins. I am working on a new XrmToolbox plug-in and I needed it myself, so I think it might come in handy for other developers. This was also a nice test of my initial thoughts on a common interface for controls and things worked out fairly well.  With the initial controls release, I included a shared interface IXrmToolboxControl though I did not go into too much detail in the post or the Wiki documentation. This interface is just intended to make things clearer when creating new controls and it was handy reminder of things to implement when creating the Entities Dropdown.  I will provide a bit more detail on the interface in the Wiki of the shared controls GitHub repository.

The new Entities Dropdown shared control is pretty self explanatory: it allows you to load a list of EntityMetadata objects into a dropdown control

This control includes a reload button but otherwise provides the standard dropdown list functionality, such as typing the Entity Name and the value is selected. The user can also reload the list using the button provided.  Once the user selects an Entity in the list, an event is fired that can be captured by the parent control.  The developer has access to both the entire list of loaded Entities and the selected item in the dropdown. More information about the control can be found in the updated Wiki pages on Github and I will be adding a few more features and documentation as I use the control myself.

As I mentioned, I’m working on a new XrmToolbox plugin in which I use the both the Entity Dropdown and the Entity List controls. I plan a followup post about how this helped in building a new XrmToolbox plugin from scratch, saving some time and allowing a focus on the specific problem at hand!

You can check out the latest code and controls posted to GitHub here: https://github.com/jamesnovak/Futurez.XrmToolbox.Controls.  Feedback on suggested features or updates are always welcomeand issues can be posted to the Issues section in GitHub.