Select to view content in your preferred language

Toggle Builder Attribute Table control visibility from custom Search Add-in

764
2
Jump to solution
05-17-2012 03:40 PM
AntonioSergio
Esri Contributor
I want to toggle the Builder Attribute table control visibility  from a custom Search Add-in, visible if the search return results, collapsed if no results return, Is there a way to do this?
0 Kudos
1 Solution

Accepted Solutions
KatherineDalton
Esri Regular Contributor
Hi Antonio,

Take a look at our Control in Layout with Toggle tool in the ArcGIS" rel="nofollow" target="_blank">http://help.arcgis.com/en/webapps/silverlightviewer/samples/s... Viewer for Silverlight Samples. This should point you in the right direction. In essence it does the following and you would replace "ChartContainer" with the FeatureDataGridContainer or any other element you wanted to toggle. This sample uses an actual tool to do the toggling, but you could adapt this as needed.

   private FrameworkElement objectToToggle;
        public void Execute(object parameter)
        {
            if (objectToToggle == null)
                objectToToggle = MapApplication.Current.FindObjectInLayout("ChartContainer") as FrameworkElement;

            if (objectToToggle != null)
                objectToToggle.Visibility = objectToToggle.Visibility == Visibility.Visible ? Visibility.Collapsed : Visibility.Visible;

        }

In this scenario, you will need to go in to your layout and find the FeatureDataGridBorder and FeatureDataGridCloseButton and set their initial opacities to 1. 

Hope that helps,

Katy
Katy Dalton | Technical Consultant
THE SCIENCE OF WHERE™

View solution in original post

0 Kudos
2 Replies
KatherineDalton
Esri Regular Contributor
Hi Antonio,

Take a look at our Control in Layout with Toggle tool in the ArcGIS" rel="nofollow" target="_blank">http://help.arcgis.com/en/webapps/silverlightviewer/samples/s... Viewer for Silverlight Samples. This should point you in the right direction. In essence it does the following and you would replace "ChartContainer" with the FeatureDataGridContainer or any other element you wanted to toggle. This sample uses an actual tool to do the toggling, but you could adapt this as needed.

   private FrameworkElement objectToToggle;
        public void Execute(object parameter)
        {
            if (objectToToggle == null)
                objectToToggle = MapApplication.Current.FindObjectInLayout("ChartContainer") as FrameworkElement;

            if (objectToToggle != null)
                objectToToggle.Visibility = objectToToggle.Visibility == Visibility.Visible ? Visibility.Collapsed : Visibility.Visible;

        }

In this scenario, you will need to go in to your layout and find the FeatureDataGridBorder and FeatureDataGridCloseButton and set their initial opacities to 1. 

Hope that helps,

Katy
Katy Dalton | Technical Consultant
THE SCIENCE OF WHERE™
0 Kudos
AntonioSergio
Esri Contributor
Thanks Katy,

works perfectly,

António Sérgio
0 Kudos