private void lstSections_SelectedIndexChanged(object sender, EventArgs e) { var section = lstSections.SelectedItem as OSGeo.MapGuide.ObjectModels.Common.DrawingSectionListSection; if (section != null) { //Enumerate the drawing layers of this section and bind the result to the layers ListBox var layers = _dwSvc.EnumerateDrawingLayers(txtDrawingSource.Text, section.Name); lstLayers.DataSource = layers; //Load the section info control, which will show more information about this section var ctrl = new SectionInfoCtrl(_dwSvc, txtDrawingSource.Text, section); ctrl.Dock = DockStyle.Fill; grpSectionDetails.Controls.Clear(); grpSectionDetails.Controls.Add(ctrl); } else { lstLayers.DataSource = null; grpSectionDetails.Controls.Clear(); } }