Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
145
Exception when adding edit controls to wingrid (v17)
posted

I am getting this error:

{"EditorControl property can only be set to a control that implements IProvidesEmbeddableEditor interface."}

Here is part of my code when I click on my 'Add' Button:

Dim uc As UltraCombo = New UltraCombo
uc.Name = "oUltraCombo"
uc.DropDownWidth = -1 ' fit the items in the drop down

With uc.DisplayLayout.Appearance
.FontData.Name = "Microsoft Sans Serif"
.FontData.SizeInPoints = 9.75
.FontData.Bold = DefaultableBoolean.False
.ForeColor = Color.Black
End With
uRow.Cells(oParam.DisplayName).EditorComponent = udd
uc.Value = uRow.Cells(oParam.DisplayName).Value

' Set the Style to DropDownValidate to trigger the data error event
' as that should limit entries to those available in the value list
uRow.Cells(oParam.DisplayName).Style = ColumnStyle.DropDownValidate

My datasource is a UltraDataSource

here is my code that builds it:

Private Sub createDataSource()
For Each oParam As Parameter In _parameters
uDataSource.Band.Columns.Add(oParam.DisplayName, GetType(String))
Next
uDataSource.Band.Columns.Add("SQLParam", GetType(String))
End Sub

I never add ultra controls dynamically before so I am not sure what to do.

  • 469350
    Suggested Answer
    Offline posted

    Hi Peter, 

    The error message you are getting here is pretty clear. But the code you posted isn't. :)

    The code you posted here is creating an UltraComboControl called "uc". But then you are setting the EditorComponent of a cell to "udd". "udd" isn't defined here, so I don't know what that control is. From the initials, I'm guessing it's an UltraDropDown control. If so, then that would explain the error message, since UltraDropdown is not an editor. 

    It seems like maybe you meant to assign the EditorComponent of the cell to uc. 

    Frankly, though if you are just trying to provide a dropdown list in a cell (or column) of the grid, UltraDropDown is typically a better option. The trick is that you have to assign it to the ValueList of the cell/column, not the EditorComponent. 

    Here's an article that might help clarify how to best provide a dropdown list in the grid: 

    http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=7841