Hi
Is it possible to use ValueLists in a column without setting the ColumnType to DropDown? We want to add a column that shows Enum values as Strings, but not in a DropDownList. The following code has no effect, the column displays the same value as if there were no ValueList.
Private Sub AddEnumTranslationTable(ByVal sFieldName As String, ByVal t As Type)
Dim vl As New UltraWebGrid.ValueList() uwg.Columns.FromKey(sFieldName).ValueList = vl For Each e As System.Enum In System.Enum.GetValues(t) Dim sLabel As String = GetEnumLabel(t, e) vl.ValueListItems.Add(n, sLabel) Next uwg.DisplayLayout.Bands(0).Columns.FromKey(sFieldName).ValueList = vl uwg.DisplayLayout.Bands(0).Columns.FromKey(sFieldName).ValueList.DisplayStyle = UltraWebGrid.ValueListDisplayStyle.DisplayText
End Sub
Is there a way for dooing this?
Thx, Lucas
Hello Lucas,Thank you for posting your request on the Infragistics WebGrid Forums. When using a ValueLists in a column, the ColumnType needs to be set to DropDown.
From your request, it seems you want to translate enumerated values from strings. If so, does the user need to be able to update this column? If not, the you may want to use an unbound column which would be useful if the column's data does not need to updated by the user.
Please let me know if this information helps or if you have any questions.
Sincerely,Mike D.Developer Support EngineerInfragistics, Inc.
Hello Mike
Thanks for your quick answer.
Yes, an unbound column solves our problem since we don't need updates.
Thx,Lucas