1

Does anyone know if grid control used within the batch mode of ArcToolbox available via ArcObjects (see image 1)?

I have used the IGPValueTable control (as used in the Union tool, image 2), however, this does not appear to allow you to add domains such as the field type drop down comboBox shown in the attached image.

Image 1: Grid control in 'Batch' mode

Image 2: IGPValueTable Table control, no domains

1 Answer 1

1

I contacted ESRI regarding this issue and they said the grid is not available via ArcObjects. However, they did demonstrate how to add a coded value domain to the list view:

'Create the list table 
Dim valueTableParameter As IGPParameterEdit = New GPParameterClass()
valueTableParameter.DataType = New GPValueTableTypeClass()
valueTableParameter.Value = New GPValueTableClass()
valueTableParameter.Direction = esriGPParameterDirection.esriGPParameterDirectionInput
valueTableParameter.DisplayName = "Input params table"
valueTableParameter.Name = "Grid"
valueTableParameter.ParameterType = esriGPParameterType.esriGPParameterTypeRequired

Dim stringColumn As IGPStringType = New GPStringTypeClass()
Dim inputLayerType As DEFileType = New DEFileTypeClass()

Dim valueTableType As IGPValueTableType = New GPValueTableTypeClass()
valueTableType.AddDataType(CType(inputLayerType, IGPDataType), "Input Features", 70, Nothing)
valueTableType.AddDataType(TryCast(stringColumn, IGPDataType), "Attribute", 100, Nothing)

valueTableParameter.DataType = TryCast(valueTableType, IGPDataType)

Dim valueTable As IGPValueTable = New GPValueTableClass()
valueTable.AddDataType(CType(inputLayerType, IGPDataType))
valueTable.AddDataType(TryCast(stringColumn, IGPDataType))

Dim attributeCodedValueDomain As IGPCodedValueDomain = New GPCodedValueDomainClass()
Const sCodes As String = "Code 1, Code 2, Code 3"
attributeCodedValueDomain.PopulateDomain(sCodes, sCodes, DirectCast(stringColumn, IGPDataType))

' Create a composite domain and add two domains, one for each column
Dim gpValueTableTypeDomain As IGPCompositeDomain = New GPCompositeDomainClass()
gpValueTableTypeDomain.AddDomain(Nothing) 'Don't want a domain on the file type. Could use IGPFileDomain if we did
gpValueTableTypeDomain.AddDomain(DirectCast(attributeCodedValueDomain, IGPDomain))

'Bind the Composite domain to the ValueTable ParameterEdit
valueTableParameter.Domain = DirectCast(gpValueTableTypeDomain, IGPDomain)

valueTableParameter.Value = TryCast(valueTable, IGPValue)
pParameters.Add(valueTableParameter)

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.