Displaying task results in a table

In this post, Tom Brenneman of ESRI Professional Services presents a Web control he developed for displaying task results in a table.

The standard Web ADF controls render task results with a tree view. This is allows multiple results as well as a variety of result types to be displayed in a uniform way. However some applications require that task results be displayed in a table without having to navigate the tree structure of the standard task results. There is an existing sample that illustrates how this can be done by working with custom tasks or application logic that dynamically updates an ASP.NET GridView control.

The custom control I’ve provided in this post is a little different in that it works with both standard tasks and custom tasks. Using this GridResults control, you can display the results of a task in a grid by simply adding the GridResults as a Task Result Container of the task. The table generated by the GridResults control also includes rows with buttons and check boxes to enable Pan, Zoom, and Select for each feature. This is what the GridResults control looks like in a web application:

GridResults control in a Web application 

As you can see in the example there are also links at the top to you can Select, Unselect, and Zoom to all of the features in the table. By clicking on the column headers you can sort data in the table. What you can’t see in the example above is that this control also supports ASP.NET themes, so you have complete control over the colors, fonts, and text sizes used by the control. Implementing themes for the control is discussed in more detail at the end of this post.

If you are using the Web Mapping Application template, there are slightly different ways to configure the grid than if you are using it in a standard web page. Below are instructions for each approach.

Using the GridResults control in a Web Mapping Application template application

  1. Install the GridResults web control.
  2. Using Visual Studio, create a new website using the Web Mapping Application template.
  3. Right-click anywhere on the Toolbox and click Choose Items…
  4. Click Browse and Navigate to gridResults.dll (Default location is C:Program FilesESRIArcGIS GridResults Control).
  5. Click OK to dismiss the Choose Toolbox Items dialog.
  6. Open the Source view for Default.aspx.
  7. Find the Results floating panel at about line 98. Highlight this block and copy it, then paste it immediately below. We are doing this with the Source view so you can be sure that the location you paste the floating panel is still in the left panel div with the rest of the floating panels. You also may want to keep the Results panel and standard task results container “TaskResults1″ for tools such as Identify.
  8. Change the Title property of the new floating panel to “Table Results”.
  9. Delete the entire TaskResults tag (TaskResults2) from the new Table Results panel.
  10. Drag gridResults from the Toolbox into the Table Results floating panel (Where the taskResults control used to exist). Your markup should look like the following.

    <esri:FloatingPanel ID="FloatingPanel1" runat="server"
    BackColor="White" BorderColor="White" BorderStyle="Solid"
    BorderWidth="1px" Font-Names="Verdana" Font-Size="8pt"
    ForeColor="Black" Height="150px" Style="position:relative; margin
    bottom:0px;" Draggable="False" Title="Table Results"
    TitleBarColor="White" TitleBarHeight="20px"
    TitleBarSeparatorLine="True" Transparency="0" Width="100%"
    HeightResizable="True" Font-Bold="True" CloseButton="False"
    TitleBarForeColor="DarkGray" Expanded="False"
    WidthResizable="False" ShowDockButton="True"
    ShowDockedContextMenu="True">
    <esri_samples:gridResults ID="GridResults1" runat="server"
    Height="200px" Style="position: absolute; overflow: auto;"
    Visible="True" Width="400px" />
    </esri:FloatingPanel>
  11. To make the grid display with scroll bars in the floating panel, we need to adjust the style attribute of the control. Change the style attribute to the following.

    Style="position:absolute; height:100%; width:100%; overflow:auto; left:0px; top:0px;"
  12. Switch to design view.
  13. Right-click on GridResults1 and click Properties.
  14. Set the Map property of the GridResults1 to the name of your map (Map1).
  15. Use the MapResourceManager to add a map resource to the application.
  16. Add tasks (such as QueryAttributesTask) to the task manager and configure their properties.
  17. Click the Smart Tag on your task(s) and click Choose Task Results container.
  18. Click Add and set the Name of the Buddy Control to GridResults1. If you use the standard TaskResults control with your tasks as well, make sure the standard TaskResults is the last one in the list.
  19. Click OK to the BuddyControl Collection Editor and run the application.
  20. When you execute the task, the floating panel will update with a table containing the results.

Using the GridResults control without a floating panel

Use the instructions below if you have created a web application without the Web Mapping Application template. In this case, you will set the style properties appropriately for your application.

  1. Open your web application in Visual Studio.
  2. Do steps 3-5 in the instructions from the previous section.
  3. Add the GridResults control to your page.
  4. Set the Map and other properties of the GridResults to display appropriately in your application. In the sample I use the following property settings.
    <esri_samples:gridResults ID="GridResults1" runat="server" Height="290px" Visible="True" Width="780px" Map="Map1" Style="position:absolute; overflow:auto; z-index: 500; left: 20px; top: 450px; vertical-align:top;" MinWidthOfZoom="0.001" />
  5. Do steps 15-20 in the instructions from the previous section.

Common properties of the GridResults control to modify

There are two additional properties that you may want to change specifically for your application: MinWidthOfZoom and ZoomExtentExpansionPercentage.

  • MinWidthOfZoom – this is the minimum width (or height actually) in map units of the extent rectangle that will be zoomed to. This is particularly useful if the result set is a single point or a very small feature. In this case you could set the minimum extent that the map will zoom to. If you are working with geographic data you may want to make this significantly smaller than the default of 10.
  • ZoomExtentExpansionPercent – this is the expansion percentage around the extent of the result set for the map to zoom to. This is useful for defining a margin around the extent of features returned in a result set.

Controlling the appearance of the results control with skins

The GridResults control is actually a Panel control containing a Label control (the resulting table name), Hyperlink controls (The zoom to all button, pan to all button, etc.), and a GridView control. The appearance of these controls honors the styleSheetTheme of your application. Using ASP.NET themes and skins you can control the look and feel of this control in your application. The following are the set of steps to enable themes and configure a skin for the table in the GridResults control. This example modifies the Blue_Bridge theme used by the Web Mapping Application template. If you aren’t using the Web Mapping Application template, you will have to create an appropriate theme for your application before walking through these steps.

  1. Enable style sheet themes by adding the following tag to your Web.config file.
    <pages styleSheetTheme="Blue_Bridge"/>

    If you are using the Web Mapping Application template you will want to leave the theme attribute as well, so your tag should look like this.

    <pages theme="Blue_Bridge" styleSheetTheme="Blue_Bridge"/>
  2. Open App_themes > Blue_Bridge > Default.skin.
  3. Add the appropriate tags to control the appearance of the Label, Hyperlink, and GridView controls contained within this control. Below is an example tag to make the symbology of the grid similar to the Blue_Bridge theme. You can copy and paste this into your skin file as an example.

    <asp:GridView runat="server" BackColor="White" BorderColor="#999999"
    BorderStyle="None" BorderWidth="1px" CellPadding="3" GridLines="Vertical">
    <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
    <RowStyle BackColor="White" ForeColor="Black" />
    <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
    <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
    <HeaderStyle BackColor="#79A8D1" Font-Bold="True" ForeColor="Black"/>
    <AlternatingRowStyle BackColor="#C0D4E4" />
    </asp:GridView>
  4. Save and run the application. When you execute the task, you should now see the results displayed in the table with a light blue header and a blue background for the alternating item (See the graphic at the top of this post for an example).

Try it out

Note: This control and its source code are provided for example purposes only and do not constitute a supported ESRI product. Please direct questions about this control to the Comments section of this blog. You may also post questions about using the ArcGIS Server Web ADF to the ESRI User Forums.

Update (February 26, 2008): I fixed a problem with the GridResults control where sorting didn’t work right when there are multiple results. This problem is most evident when you use the GridResults control with the Identify tool. This new control is available on ArcScripts here: http://arcscripts.esri.com/details.asp?dbid=15452 .

This entry was posted in Services and tagged , , , . Bookmark the permalink.

Leave a Reply

50 Comments

  1. cyndiee says:

    This looks great! Thank you so much for your work on this. Does it require SP3? I received an error adding it to my toolbar and I suspect that may be why. Also, I have a field marked as a hyperlink field in my map document. Does this by chance support hyperlinked fields?

    Thanks again!

  2. TomLUX says:

    This is very helpful.

    I’m trying to build this on ArcGIS Server for Java.

    I wanted to use Icefaces or Richfaces fot building a such complex Table.

    Unfortanly, I can’t get working the combination of Iceface/ArcGIS JSF resp. Richfaces/ArcGIS JSF library.

    Has anybody a JAVA solution for this example?

    Thanks,
    Tom

  3. vinnymac says:

    Where is GridResults_Display.js

    I don’t see it in the source?

  4. cyndiee says:

    The “Hyperlinking in task results” blog from July shows an example (in C++ though I’m using VB) of how to override the ExecuteTask method to create a hyperlink in the results. Can this be done with the GridResults Control also?

  5. tbrenneman@esri.com says:

    Michael,

    Yes it looks like my code doesn’t do sorting well when there are multiple table results. Currently the control just tracks column and sort order but it should store a collection of objects with info for how each table should be sorted. I’m not sure if I will have time to fix this but if you want to tackle it yourself RefreshGrid in gridresults.cs is a good place to start. If I get a chance to fix it, I’ll repost.

  6. TToutant says:

    Is there a way to adjust what fields display in the gridresults? I don’t need them all.

  7. Tink0519 says:

    TToutant,
    You can limit the number of fields a couple of ways. If you’re not coding, use the mxd by going into the layer properties and choosing the fields that should be visible. Or, using .NET you can list the fields you’d like to return:

    string list = “Field1,Field2,Field3″;
    String[] flds = list.Split(‘,’);
    ESRI.ArcGIS.ADF.StringCollection scoll = new ESRI.ArcGIS.ADF.StringCollection(flds);
    queryfilter.SubFields = scoll;

  8. Tink0519 says:

    Is there a way to change the field names? I have a join in my mxd, so the field names are really long.

  9. Tink0519 says:

    Nipa,

    Which object is your error refering to?

  10. Tink0519 says:

    Rocky, The code snippet filters the field list return from the mxd. However, there are some fields that have to be returned, such as ADF Geometry. This field isn’t in the MXD, but is used in the graphics layer within the ArcServer enviroment. To turn off those fields you need to make changes in the source code and recomplie the dll.

    In the source code, open gridResults.cs and search for: dc.ColumnName != pGl.GraphicsIDColumn.ColumnName

    Here you will find a list of the column names gridResults does not display such as “IS_SELECTED” and “SHAPE”. Add any column names you do not want displayed to that if statement:
    && dc.ColumnName.ToUpper() != “ADF GEOMETRY”

    Make sure you completely remove gridResults from your website before you try to use your newly compiled version, including removing the assembly reference in the web.config file. Hope this helps. -Trent, ROK Technologies

  11. abakhtiyarov says:

    Tink0519 or Anyone, I downloaded the source code to my computer, now I am lost. I have created an application and added the gridResults web control to it I installed it than added to my toolbox and i am using it in my application to make Limiting Fields what do i do next what code i need to add to my application what steps i need to take do I need.

    I am just trying to put the source code to my application so I can Limit the Fields, any help is a big help. Thank you.

  12. drprune says:

    I’d like to have the table launch in a new popup window – is this possible?

  13. BennyHusted says:

    Tom, would it be possible to add a linkbutton template to the gridresultstemplates.cs so that when that value was clicked it would zoom to that portion of the map?

    Right now I’ve tried to make a linkbutton that will zoom to that portion of the map by modifying the GridViewButtonTemplate so that it works with a link button, but provides the functionality of the imagebutton. It still doesn’t show up as a link though, and when I click on it nothing happens?

    Is there some kind of event handler that isn’t being specified? Does this make sense to you at all?

  14. BennyHusted says:

    Also, is there an easy way to make the selected column a radiobutton? I tried modifying the gridViewCheckBoxTemplate to use a radiobutton instead of a checkbox, but I can still select many of the results. I made sure the radiobuttons were using the same groupname too.

    My goal here is to have only one result selected at any given moment.

    Any ideas?

  15. bobtec says:

    How do you debug the dll so I can step through it?

  16. Nipa says:

    Has anyone tried to combine this with the Custom Select Tool Task (http://arcscripts.esri.com/details.asp?dbid=15133)? I am trying to incorporate this now, but it doesn’t like it when it get to the GetTaskResultsControls function.

  17. aroranidh says:

    I want to implement same technology in JAVA If anybody has Java so;ution for this scenerio, Please provide the same.

    Thanks

  18. Nipa says:

    Hi Surender,
    Thanks for your code but I’m having the same issue of not displaying Gridresults. Please let me know if you find any solution.

    Thanks.

    Nipa

  19. Nipa says:

    Hi Surender,
    I was looking at your code and trying to compare with mine and I see two differences.

    I’m using dropdown list to build my query and hit a submit button that actually calls the function and then display the result in the grid results.

    Can you please tell me how should I have my button_click event display the gridresults.

    Map1.CallbackResults.ToString() has the whole gridresults content but just not displaying it.

    I can really use some help because I’m stuck and can’t move forward.

    Nipa

  20. LParson says:

    It works fine but in the data table , I still get 3 first columns: GeometryElement, FID, Shape, that I do not need to be shown.

    I use ArcMap to make these fields invisible but still in the application, they are still there.

    Could you please tell me how to limit the fields and do not have these 3 fields displaying in the table?

    I try to read all the comments here but could not make it.

    Thanks for your help !

  21. Nipa says:

    Has anyone added “run task again” or “remove” context menu items to the gridresults like it comes with the out-of-box taskresults container?

    Nipa

  22. tesladaman says:

    First of all, excellent tool and code for Grid Results; thank you!
    Second, I get the following error when trying to access it online from the host machine (NOTE: Line 37 is marked in red):

    Line 35:
    Line 36:
    Line 37:
    Line 38:
    Line 39:

    I can view it using “View in Browser,” but not when entering the full URL.

  23. tesladaman says:

    never mind, I figured it out, missed a step:)

  24. wherewhy says:

    Tom, thanks for putting up such a great tool.
    I’m having a bit of trouble getting the Identify to work. I have set up as you instructed above, however, in the Identify.cs file, I get the following error when I do an identify click on the map at the following code line:

    m_resultsDisplay.DisplayResults(null, null, null, gdsList[i]);

    “You must set the Map property to a valid map”

    Any ideas??

  25. jvickrey79 says:

    Hello- I know all the developers get busy but I really need to know how and where to add code to this application that will “Total” the Shape_Length field and display it in a label..

    Thanks for any help…

    Regards,

  26. tbrenneman@esri.com says:

    All,

    I fixed a problem with the gridResults control where sorting didn’t work right when there are multiple results. This problem is most evident when you use the gridResults control with the identify tool. This new control is available on ArcScripts here: http://arcscripts.esri.com/details.asp?dbid=15452 .

  27. sterlingdq says:

    Miri- Are you trying to get more or fewer than 500 records returned? You may have some success by changing the MaxRecordCount tag in the service configuration file. Go to your ArcGIS Server install directoryserverusercfg and you will see the configuration files. You can edit them in Notepad. Notice that the MaxRecordCount value is 500 by default. You can edit this as needed and restart the ArcGIS Server Object Manager service to apply the changes.

  28. pragada_rk says:

    Hi Tom, thanks for your great work for excellent tool. It helped me a lot. I am integrating your gridResults controls with my custom search task.Every thing is worked fine until I added more than one search tasks to my application. I added 2 search tasks and 2 gridResults to display the results of each search task in separate gridResults. when I executed the first search task it worked fine and displayed the results in associated gridResults. However when I executed the second search task, it successfully return the result and displayed in the 2nd gridResults, but results in 1st gridResults is replaced with the new results. Basically i want separate results for each search task.

    I would be thankful, if someone can help me.

    Thanks in advance.

    Krishna

  29. josh5000 says:

    Tom Brenneman,

    I tried appending the additional case statement to the gridresults.cs file and recompiling a new dll.

    However, I get the following error:

    Unable to cast object of type ‘System.Data.DataColumn’ to type ‘System.Web.UI.WebControls.TemplateField’

    Is there anyway you can send me your edited/updated gridresults.cs file s othat I can use this feature in my web application?
    My email is nelsonrj@hotmail.com.

    Thank you.

  30. josh5000 says:

    Hello,

    Can anyone help me with some code on how to write the selected rows from the gridresults to an access or sql table?

    Thanks.

  31. josh5000 says:

    Does anyone know how to rewrite these lines from Josh to C#:

    Dim pTaskRes As ITaskResultsContainer = TryCast(gResults, ITaskResultsContainer)

    Dim gResults As esri_samples.gridResults = esri_samples.Utils.FindControl(Of esri_samples.gridResults)(Map1.Page, “GridResults1″)

  32. dynamic80 says:

    Josh, how did you implement that code for exporting to Excel? I am confused on where to exactly put it since I am very inexperienced with coding. If you can email me at fernandol@burienwa.gov witht he steps? Thanks!

  33. bcales says:

    Could not load file or assembly ‘gridResults, Version=1.3.1.0, Culture=neutral, PublicKeyToken=4117b0729e6ae73a’ or one of its dependencies. The system cannot find the file specified

    It wants me to make a registry change – but I don’t want to do that to all my users?

  34. josh5000 says:

    Josh – thanks for the help.

    I am also looking to directly get a grasp of the gridview that is within this control so that I can iterate through each row/record returned.

    Does anyone know how to get to the gridview control? Looks like it’s nested right?

    Thanks.

  35. josh5000 says:

    Surender,

    I am unable to use your sample to get the excel export to work.

    Is there anyway you can email me your gridresults.cs file (nelsonrj@hotmail.com).

    Please let me know.
    Thanks.

  36. Nipa says:

    Josh,
    Here is the code I use to loop thru gridresults gridview and get the value of selected checkbox. I’m creating a session variable and pass that list to the next page.
    I hope this helps.

    Function SubsetSelectionFromGridResults()

    If Not Me.GridResults1.ResultsGraphicsDataset Is Nothing Then
    Dim recMumView As DataView = GridResults1.ResultsGraphicsDataset.Tables(0).DefaultView

    Dim recNumDataTable As DataTable
    Dim i, j As Integer
    Dim tmp As String = “”
    Dim selected As Boolean
    Dim recNumList As New ArrayList
    Dim SelRecnum As String = “”

    recNumDataTable = recMumView.Table

    For i = 0 To recNumDataTable.Rows.Count – 1
    selected = recNumDataTable.Rows(i)(“IS_SELECTED”)
    If selected = True Then
    recNumList.Add(recNumDataTable.Rows(i)(“RecNum”))
    End If
    Next

    If recNumList.Count > 0 Then
    For j = 0 To recNumList.Count – 1
    tmp &= recNumList(j).ToString + “,”
    Next
    End If

    If tmp.Length >= 2 Then
    SelRecnum = Left(tmp, tmp.Length – 1)
    End If

    Session(“SelRecnum”) = SelRecnum

    Dim aURL As String = “buildOrderform.aspx”

    Dim returnstring As String
    Dim sw As New System.IO.StringWriter()
    Dim htw As New HtmlTextWriter(sw)
    htw.Flush()
    returnstring = sw.ToString()

    Dim sb As New System.Text.StringBuilder
    sb.Append(“OpenWindow=window.open(‘” + aURL + “‘, ‘CustomPopUp’,”)
    sb.Append(“‘width=800, height=800, menubar=yes, resizable=1,scrollbars=1′);”)
    Dim cr As New CallbackResult(Nothing, Nothing, “javascript”, sb.ToString)
    Map1.CallbackResults.Add(cr)
    Dim jsChangeCursor As String = “map.divObject.style.cursor = map.cursor”
    Dim cursorCallbackResult As ESRI.ArcGIS.ADF.Web.UI.WebControls.CallbackResult = New ESRI.ArcGIS.ADF.Web.UI.WebControls.CallbackResult(Nothing, Nothing, “javascript”, jsChangeCursor)
    Map1.CallbackResults.Add(cursorCallbackResult)

    Return Map1.CallbackResults.ToString()

    End If

  37. Nipa says:

    I’m still waiting for someone to give me export to excel function built in with gridresults.

    I would really appreciate.

    My email id: parikhnipa@hotmail.com

  38. bcales says:

    I’m trying to add a bottom panel below the map that will automatically expand when results are posted – similar to the side panel

  39. bcales says:

    Could not load file or assembly ‘gridResults, Version=1.3.1.0, Culture=neutral, PublicKeyToken=4117b0729e6ae73a’ or one of its dependencies. The system cannot find the file specified.

    Do I have to install it on the server? I added the .dll as a resource, but that didn’t do it.

  40. dynamic80 says:

    Any resolution to those trying to use the Export to Excel in the source code? I tried that also and cannot get it to work. Other than the code pasted here, are there missing steps?

    I was able to get the other code to run during runtime and outside form modifying the source code, and am still battling how to truly make it user friendly with the help from Josh. But tearing my hair out the past few days to get a simple thing as exporting to a spreadheet is getting frustrating.

    Hope someone found something with some documentation on how to implement so that the community can take advantage of it. :)

  41. pvcuervas says:

    Great component!. I use it on various projects, adding the export capability. But, How i can add the paging capability whitout recharging the page?. Looking the source-code i find the GridView instance, but at the moment i add the sorting and paging property, its return me an error.

    I think, it’s like the sorting functionality, but i don’t find the way.

    Thanks at all.

  42. bcales says:

    Anyone able to get the results to display below the map in a panel that can be hidden, similar to the side panel.

    Or like Tony asked about having the results show in a new window

  43. bcales says:

    How do you initiate the gridViewExport – I see the code, but there is no button

  44. sahale says:

    I loaded the gridResults project source into my own map viewer project so that I could customize it. I was able to do so and can compile as a new version (1.3.1.1), make changes, etc. and they are reflected in my map viewer. However to avoid any version conflicts with the version provided in this blog (v1.3.1.0), I uninstalled v1.3.1.0 first and then added v1.3.1.1 to my VS Toolbar. Again, everything in my project works fine.

    However, when I try to start the ArcGIS Manager console (the compiled web app that gets installed w/ ArcGIS Server and which runs on the same dev machine) I get the following exception:


    An error has occurred at: http://localhost/ArcGIS/Manager/login.aspx?ReturnUrl=/ArcGIS/Manager/GISServer/Default.aspx.

    Could not load file or assembly ‘gridResults, Version=1.3.1.0, Culture=neutral, PublicKeyToken=4117b0729e6ae73a’ or one of its dependencies. The system cannot find the file specified.

    For more details, check Manager’s web server application event log.


    The IIS logs contain no additional information (at least not anything helpful). The Manager app is pre-compiled and contains no references to gridResults in the web.config or anywhere else, so I’m not sure where it’s picking up this dependency.

    Has this happened to anyone else?

  45. sahale says:

    Aaron:

    Here’s what I did (I may have the order slightly off since I’m going off of memory but overall it should work for you):

    1. Remove the grid from your toolbar: right-click in toolbar and select ‘Choose Items…’, then uncheck ‘gridResults’ box in ‘Choose Toolbox Items’ window

    2. Uninstall the version of the control on your dev server using the uninstaller that was laid down when you installed the control, e.g. GridResultsInstallDebugsetup.exe (I might have the name wrong since I’ve already uninstalled and the uninstaller itself was removed, so there might be an uninstall program named something other than ‘setup.exe’). BEWARE: If your dev server also hosts your ArcGIS Manager web app, it may break Manager. This happened to me and I’ve yet to find a fix (see ‘error invoking Manager after modifying gridResults’ post immed. above yours).

    3. Download the latest (v1.3.1) source from the ArcScripts link above or here: http://arcscripts.esri.com/details.asp?dbid=15452

    4. In Visual Studio in your map viewer project, select ‘File > Add > Exiting Project…’, browse to your gridResults source and add the project ‘gridResults.csproj’. The ‘gridResults’ project should appear in Solution Explorer.

    5. Compile the project (you can do so either by right-clicking the ‘gridResults’ and selecting ‘Build’ or by building your whole project).

    6. Add the control to your toolbox using the steps in #1 above and selecting ‘Browse’, browse to gridResults.dll. This step may not be necessary since you may not need the control in your toolbox to add it to your project if you’ve added the gridResults to the same solution where you’re using it.

  46. sahale says:

    Aaron:

    Here’s what I did (I may have the order slightly off since I’m going off of memory but overall it should work for you):

    1. Remove the grid from your toolbar: right-click in toolbar and select ‘Choose Items…’, then uncheck ‘gridResults’ box in ‘Choose Toolbox Items’ window

    2. Uninstall the version of the control on your dev server using the uninstaller that was laid down when you installed the control, e.g. GridResultsInstallDebugsetup.exe (I might have the name wrong since I’ve already uninstalled and the uninstaller itself was removed, so there might be an uninstall program named something other than ‘setup.exe’). BEWARE: If your dev server also hosts your ArcGIS Manager web app, it may break Manager. This happened to me and I’ve yet to find a fix (see ‘error invoking Manager after modifying gridResults’ post immed. above yours).

    3. Download the latest (v1.3.1) source from the ArcScripts link above or here: http://arcscripts.esri.com/details.asp?dbid=15452

    4. In Visual Studio in your map viewer project, select ‘File > Add > Exiting Project…’, browse to your gridResults source and add the project ‘gridResults.csproj’. The ‘gridResults’ project should appear in Solution Explorer.

    5. Compile the project (you can do so either by right-clicking the ‘gridResults’ and selecting ‘Build’ or by building your whole project).

    6. Add the control to your toolbox using the steps in #1 above and selecting ‘Browse’, browse to gridResults.dll. This step may not be necessary since you may not need the control in your toolbox to add it to your project if you’ve added the gridResults to the same solution where you’re using it.

    7. Modify your map viewer project so that it reflects the new version (which should be 1.3.1.0 if you haven’t changed it in Assembly.cs):
    – Default.aspx:

    – web.config:

  47. ammielke says:

    sahale
    Thanks for you detailed description, however I am still not getting it to work. I noticed that the new version is different

    && dc.ColumnName.ToUpper() != pGl.IsSelectedColumn.ColumnName.ToUpper()

    versus

    && dc.ColumnName.ToUpper() != “IS_SELECTED”

    I have tried adding several column names

    && dc.ColumnName.ToUpper() != “Shape Area”
    && dc.ColumnName.ToUpper() != “Shape”
    && dc.ColumnName.ToUpper() != “SHAPE”
    && dc.ColumnName.ToUpper() != “Shape_Area”

    I continue to get the fields “Shape Area” and “Shape Length” showing up. What do I need to type to have them not appear.

    I have tested this with other common fields and that does not work either.

    Thanks for all your help. If I could get this figured out that would be great.

  48. stiggy says:

    Is there a way to use this tool with non-spatial data? I need to query a non-spatial database, return the results, and somehow allow the user to zoom to the point features that are related to the non-spatial records. I do have a field in common in both my spatial and non-spatial data to use as a relate. And, no, I cannot create a spatial view, these datasets are on two different servers. I’m doing this using a custom task I developed. Can I simply add the spatial information to my non-spatial dataset? i.e. – add x and y fields?

  49. shawnaphelps says:

    Aaron,

    Yes, any changes to the gridResults project code requires that you rebuild the dll. Make the changes I suggested, then follow the below steps:

    1. Change the Assembly and File Version:

    a. In Visual Studios right click on the “Properties” folder in your solution. Choose “Open”. This will open the properties window for your project.
    b. You will see several tabs on the left. Find and click on the tab called “Application”.
    c. In the Application section there is a button called “Assembly Information…” Click on this. This will open another little window.
    d. There are four boxes next to “Assembly Version” and “File Version”. You need to change one of the numbers. I beleive the original build numbers are 1.3.1.0. So if this is right, you would want to change the numbers to 1.3.1.1, for both the assembly and file version.
    e. Build the solution.

    2. Register with the gac utility.

    a. Open the Visual Studio command prompt. (This is located in the “Visual Studio Tools” in your Programs Menu under Microsoft Visual Studio 2005).
    b. When you built your project the dll was created in the “binRelease” directory of your project directory. You will need to find that path for the following command. For example, I stored my project on my D drive: “D:VisualStudioProjectsGridResultsbinRelease”
    c. Use the following command in the VS command prompt to register your dll (gacutil -i ):

    gacutil -i D:VisualStudioProjects
    GridResultsbinReleasegridResults.dll

    If successful you should recieve the following message:

    Microsoft (R) .NET Global Assembly Cache Utility. Version 2.0.50727.42
    Copyright (c) Microsoft Corporation. All rights reserved.

    Assembly successfully added to the cache

    3. Point your application to use the new dll version.

    a. Change the version number of the dll. in the Default.aspx file. Assemblies are registered at the top of the default.aspx file. Change the version to the number you used in step one. My last build number was 1.3.1.33 as seen below:

    b. Change the version number of the dll in the web.config file. The tags in the web.config need to be changed as well. Look for the gridResults and chnage the version number to the number from step one, also.

    4. Recomplie your web application. Your web application is now using the new version of the dll.

    Each time you make a change to the gridResults code, you have to go through these steps using a different build number each time. Also, if you want to load your application on another ArcGIS Server you will have to copy your new version of the dll (the file itself) up to the new server, then follow step 2 to register it with the GAC.

    =) Hope these directions are clear. If not, let me know where your hung up and I’ll try to expand more. Shawna.

  50. sterlingdq says:

    We’re happy to see that many of you are making use of this control. Also, the community that has grown around this thread is impressive. We have no wish to break it up. However, since this thread has grown a little unweildy we would like to ask that you continue discussion of this GridResults control on the ArcGIS Server ESRI User Forums at http://forums.esri.com/Forums.asp?c=158. We suggest that you post your threads about this control in the ArcGIS Server .Net: Web ADF category.

    If there’s more information about the control that becomes available, we’ll post it here. But new comments to this particular post have been disabled.

    Thanks and hope to see you on the forums,

    -The ArcGIS Server Development Team