Hi!
There are two options for grouping devices. First is manual - you can select "Bind" from any container popup menu, and select nodes you want to put into this container. Second option is to setup automatic binding. To do that, you should open container's properties and write your filtering script on "Automatic Bind Rules" page. Script will be called for each node during configuration poll and should return TRUE for nodes that should be placed into container. There are examples of the scripts on the forum and in wiki: http://wiki.netxms.org/wiki/Scripting_Guide.
Best regards,
Victor