Select to view content in your preferred language

Attribute Query Sample ??? Should newly added record show up in Query

1581
5
Jump to solution
09-28-2012 02:31 PM
GreggBreton
Occasional Contributor
Utilizing the attribute sample as a drop down to select a record (site location) and zoom to that site location (like the states example). Works fine

I add a record (site location) using the editor widget to the list of sites that is not versioned (default). I check the mxd and it adds the record.

When I clear my cache, go back to the attribute query should I not be able to see the newly added site (state) in my query? Is there additional code for the sample that is needed to be able to see the newly added site in the drop down list?

I have a table of records (no geometry) and I am able to add records and immediately see those records in a query , but not able to see the newly added record (with geometry) in my attribute query (default, non-versioned sde database).

[ATTACH=CONFIG]18085[/ATTACH]
0 Kudos
1 Solution

Accepted Solutions
GreggBreton
Occasional Contributor
OK this is for Dominique and Andrew,

I will close out this post, almost don't want to say 🙂 When utilizing the attribute query sample, I could not get it to work with points and ended up doing a buffer for the points, and the sample worked fine.

Now I need to go back to the original sample provided try to get it to work with points.

Close out this, research the forum first to find posts relating to getting the attribute sample to work with points and then I should be all set. Thank you both

View solution in original post

0 Kudos
5 Replies
DominiqueBroux
Esri Frequent Contributor
Maybe a browser cache issue. Try by setting DisableClientCaching (of your query or your layer) to true.
0 Kudos
GreggBreton
Occasional Contributor
Hello Dominique

First I double checked the mxd SDE default just to make sure the record was added. It was-

Added the queryTask.DisableClientCaching = true; to the Query box for both the initialization and query

Code Behind

public MainPage()
        {
            InitializeComponent();
            

            //Query Task To load Water Quality Sites in Drop Down Box
            QueryTask queryTask = new QueryTask("url");
            queryTask.DisableClientCaching = true;
            queryTask.ExecuteCompleted += QueryTask_ExecuteCompleted;
            queryTask.Failed += QueryTask3_Failed;


Code Behind Continued

//Water Quality Site Query Step 2
        private void QueryComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (QueryComboBox.SelectedItem.ToString().Contains("Select..."))
                return;

            QueryTask queryTask = new QueryTask("url");
            queryTask.ExecuteCompleted += QueryTask_ExecuteCompleted;
            queryTask.DisableClientCaching = true;
            
            queryTask.Failed += QueryTask_Failed;

            ESRI.ArcGIS.Client.Tasks.Query query = new ESRI.ArcGIS.Client.Tasks.Query();
            query.ReturnGeometry = true;
            query.Text = QueryComboBox.SelectedItem.ToString();
            query.OutSpatialReference = Map.SpatialReference;
            query.OutFields.Add("Site_ID,River_Name,Latitude,Longitude,Elevation,Location,Country");


XAML
<Border x:Name="QueryBorder"
                Style="{StaticResource CommonBorder}"
                VerticalAlignment="Top"
                HorizontalAlignment="Right"
                Visibility="Collapsed"
                Margin="5,60">
            <Grid x:Name="QueryGrid"
                  HorizontalAlignment="Right"
                  VerticalAlignment="Top">
                <Grid.RowDefinitions>
                    <RowDefinition Height="30" />
                    <RowDefinition Height="30" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <TextBlock x:Name="DataDisplayTitleBottom"
                           Text="Select a Water Quality Site"
                           Foreground="White"
                           FontSize="12"
                           Grid.Row="0"
                           Margin="15,5,15,1"
                           HorizontalAlignment="Center">
                    <TextBlock.Effect>
                        <DropShadowEffect />                          
                    </TextBlock.Effect>
                </TextBlock>
                <ComboBox x:Name="QueryComboBox"
                          Grid.Row="1"
                          MinWidth="150"
                          SelectionChanged="QueryComboBox_SelectionChanged"
                          Margin="5,1,5,5">
                </ComboBox>
                <ScrollViewer x:Name="DataGridScrollViewer"
                              HorizontalScrollBarVisibility="Hidden"
                              VerticalScrollBarVisibility="Auto"
                              Width="230"
                              MinHeight="200"
                              Visibility="Collapsed"
                              Grid.Row="2">
                    <slData:DataGrid x:Name="QueryDetailsDataGrid"
                                     AutoGenerateColumns="False"
                                     HeadersVisibility="None"
                                     Background="White">
                        <slData:DataGrid.Columns>
                            <slData:DataGridTextColumn Binding="{Binding Path=Key}"
                                                       FontWeight="Bold" />
                            <slData:DataGridTextColumn Binding="{Binding Path=Value}" />
                        </slData:DataGrid.Columns>
                    </slData:DataGrid>
                </ScrollViewer>
            </Grid>
        </Border>


Will continue troubleshooting and thank you - will let you know
0 Kudos
deleted-user-ATjHIWsdQYmT
Deactivated User
Gregg- Try re-binding your datagrid to your featureset.  Clear the datagrid then re-bind it.
0 Kudos
GreggBreton
Occasional Contributor
OK this is for Dominique and Andrew,

I will close out this post, almost don't want to say 🙂 When utilizing the attribute query sample, I could not get it to work with points and ended up doing a buffer for the points, and the sample worked fine.

Now I need to go back to the original sample provided try to get it to work with points.

Close out this, research the forum first to find posts relating to getting the attribute sample to work with points and then I should be all set. Thank you both
0 Kudos
GreggBreton
Occasional Contributor
Zoom To Point resolved the issue


Thank you
0 Kudos