Select to view content in your preferred language

Creating a Feature Data Grid Add-In

3603
4
Jump to solution
10-29-2013 04:24 PM
TomFlahive
Occasional Contributor
I would like to create an Add-In for Silverlight Viewer that looks and behaves exactly like the Feature Data Grid sample from the ArcGIS API for Silverlight (its in the Editing group):

http://resources.arcgis.com/en/help/silverlight-api/samples/start.htm#ToolkitFeatureDataGrid

What is the best approach for accomplishing that?

Thanks.
0 Kudos
1 Solution

Accepted Solutions
PietaSwanepoel2
Frequent Contributor
Tom,

you will have to create a new layout that will accommodate the extra panel (datagrid) that you will be adding to the application. If the datagrid needs to be active all the time it could be a behavior otherwise make it an add-in that will open/close the grid as required. You can configure the add-in to consume a specific feature service that will be displayed in the datagrid

Example code on how to show hide the featuredatagrid:

            // Find FeatureDataGridContainer             ContentControl attribPanel = MapApplication.Current.FindObjectInLayout("FeatureDataGridContainer") as ContentControl;             if (attribPanel != null)             {                 Storyboard storyBoard;                 // Check whether the control needs to be shown or hidden                 if (attribPanel.Visibility == Visibility.Collapsed)                 {                     // Check whether the side panel has a visual state called Show.  If so, we'll show the side                     // panel by invoking the storyboard from this state.                     storyBoard = VisualStateManagerHelper.FindVisualStateStoryboard(attribPanel, null, "Show", true);                     if (storyBoard != null)                         storyBoard.Begin();                     else // The side panel does not have a Show state, so set the panel's visibility directly                         attribPanel.Visibility = Visibility.Visible;                 }                 else                 {                     // The toggle button is being clicked when the control is already visible.  So the click should hide it.                      // Check whether the side panel has a visual state called Hide.  If so, we'll hide the side                     // panel by invoking the storyboard from this state.                     storyBoard = VisualStateManagerHelper.FindVisualStateStoryboard(attribPanel, null, "Hide", true);                     if (storyBoard != null)                         storyBoard.Begin();                     else // The side panel does not have a Hide state, so set the panel's visibility directly                         attribPanel.Visibility = Visibility.Collapsed;                 }             }

View solution in original post

0 Kudos
4 Replies
PietaSwanepoel2
Frequent Contributor
Tom,

you could use the normal functionality for the Silverlight application builder.
The service you consume must have feature access capability enabled (make sure you enabled updating for features). The data will have to be a SDE datasource.
The SDE feature class must be VERSIONED.
Might be some other permissions related to SDE access as well
0 Kudos
TomFlahive
Occasional Contributor
Thanks for your reply Pieta.  By normal functionality, I think you are referring to the Attribute Table that is included by default in a Silverlight builder application.  I am aware of this control, but I don't believe I can get it to function the way I want, and thus I am seeking to create my own Add-In grid that is very similar, but can be customized the way I need it to be.

Here are the two things I would like to be able to do with this Add-In:

1. Like the sample I linked to above, I only want the data from one particular layer to show in the grid at all times, regardless of what layer the user has selected.

2. I also don't want to show any of the icons that appear on the bottom right of the built in Attribute Table (such as the "show selected" and the "select" icons).  I don't need any editing functionality, just straight data display.

If I can accomplish these two things with the built in Attribute Table--show only data from one layer at all times, and customize the grid to hide certain icons and unneeded functionality--then I can use that built in table.  Otherwise, I think I would need to create a custom Add-In.

Related to my original question on what is the best approach, I guess I have two main questions:

1. Would I create this kind of Add-In as a Tool or as a Control? 

2. Is there some way to get my grid table to show up in the same location as the built in Attribute Table control, and behave the same way?  For example, if my Add-In is open, and someone then opens the Map Contents grid, I want my Add-In grid to make room for that Map Contents grid and not overlap it.  Just the way the built in Attribute Table works.  But I am not clear how to accomplish that.

Any help would be appreciated.  Thanks.
0 Kudos
PietaSwanepoel2
Frequent Contributor
Tom,

you will have to create a new layout that will accommodate the extra panel (datagrid) that you will be adding to the application. If the datagrid needs to be active all the time it could be a behavior otherwise make it an add-in that will open/close the grid as required. You can configure the add-in to consume a specific feature service that will be displayed in the datagrid

Example code on how to show hide the featuredatagrid:

            // Find FeatureDataGridContainer             ContentControl attribPanel = MapApplication.Current.FindObjectInLayout("FeatureDataGridContainer") as ContentControl;             if (attribPanel != null)             {                 Storyboard storyBoard;                 // Check whether the control needs to be shown or hidden                 if (attribPanel.Visibility == Visibility.Collapsed)                 {                     // Check whether the side panel has a visual state called Show.  If so, we'll show the side                     // panel by invoking the storyboard from this state.                     storyBoard = VisualStateManagerHelper.FindVisualStateStoryboard(attribPanel, null, "Show", true);                     if (storyBoard != null)                         storyBoard.Begin();                     else // The side panel does not have a Show state, so set the panel's visibility directly                         attribPanel.Visibility = Visibility.Visible;                 }                 else                 {                     // The toggle button is being clicked when the control is already visible.  So the click should hide it.                      // Check whether the side panel has a visual state called Hide.  If so, we'll hide the side                     // panel by invoking the storyboard from this state.                     storyBoard = VisualStateManagerHelper.FindVisualStateStoryboard(attribPanel, null, "Hide", true);                     if (storyBoard != null)                         storyBoard.Begin();                     else // The side panel does not have a Hide state, so set the panel's visibility directly                         attribPanel.Visibility = Visibility.Collapsed;                 }             }
0 Kudos
TomFlahive
Occasional Contributor
Thanks Pieta.  I hadn't thought about creating a new layout to accomplish this.  I think you have given me enough to get started.
0 Kudos