Select to view content in your preferred language

FeatureDatagrid columns visibility

869
2
Jump to solution
06-05-2012 04:41 AM
bayramüçüncü
Deactivated User
Hi,
I wanna set the visibility unvisible, some columns of my featuredatagrid.
I am binding a featuredatalayer to datagrid. I can specify the visible layers in featurelayer. but I wanna see all of properties in map tip, when I click the layer on the map.
So a cannot limited the featuredatalayer. So I need specify the featuredatagrid columns visibility.

I used the following code but this not worked

xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"

<esri:FeatureDataGrid x:Name="mygrid" Map="{Binding ElementName=Map}" HeadersVisibility="Column" GraphicsLayer="{Binding ElementName=Map, Path=Layers.[cities]}">
                <esri:FeatureDataGrid.Columns>
                    <data: DataGridTextColumn Binding="{Binding Attributes[NAME]}" Visibility="Collapsed"/>
                </esri:FeatureDataGrid.Columns>
            </esri:FeatureDataGrid>

This is not worked
<data: DataGridTextColumn Binding="{Binding Attributes[NAME]}" Visibility="Collapsed"/>
0 Kudos
1 Solution

Accepted Solutions
JoeHershman
MVP Alum
The visible columns is tied to the OutFields collection so the easiest way is to just set the OutFields to only the ones you want.  But it seems you want attributes available for the map tip that do not show up.

While I have not done it FeatureDataGrid inherits from DataGrid so I assume you can set the Columns like you have started to below.  In order to do this you need to first set the AutoGererateColumns  property on the FeatureDataGrid to false.  Then in your Columns definition only put the ones you do want to see\


Hope that helps
-Joe
Thanks,
-Joe

View solution in original post

0 Kudos
2 Replies
JoeHershman
MVP Alum
The visible columns is tied to the OutFields collection so the easiest way is to just set the OutFields to only the ones you want.  But it seems you want attributes available for the map tip that do not show up.

While I have not done it FeatureDataGrid inherits from DataGrid so I assume you can set the Columns like you have started to below.  In order to do this you need to first set the AutoGererateColumns  property on the FeatureDataGrid to false.  Then in your Columns definition only put the ones you do want to see\


Hope that helps
-Joe
Thanks,
-Joe
0 Kudos
bayramüçüncü
Deactivated User
The visible columns is tied to the OutFields collection so the easiest way is to just set the OutFields to only the ones you want.  But it seems you want attributes available for the map tip that do not show up.

While I have not done it FeatureDataGrid inherits from DataGrid so I assume you can set the Columns like you have started to below.  In order to do this you need to first set the AutoGererateColumns  property on the FeatureDataGrid to false.  Then in your Columns definition only put the ones you do want to see\


Hope that helps
-Joe


Thanks minerjoe,
I setted AutoGeneratedColumns=false, property of featuredatagrid

<data: DataGridTextColumn Binding="{Binding NAME}" Header="City Name"/>
(not Binding [NAME], this not worked)

the problem solved.
0 Kudos