I am working with GridDropDownColumn and I need to show a treeview
inside the combobox or at least be able to add some icons to each entry.
I know that a good way would be to use a template column and handle
everything manually, and that is what I am trying to avoid, because
it's so easy to use a dropdownColumn and rest assured that db operations
as well as grouping and sorting would be taken care of automatically.
I have tried the following code:
and the result can be seen in the attached picture and it does not look very elegant. (because it is not a treeview)
Should I go for the template column solution or do you suggest a better one?
Thank you very much.
Safa
I have tried the following code:
| Private Sub grdOrderable_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles grdOrderable.ItemDataBound |
| If e.Item.IsInEditMode And TypeOf (e.Item) Is GridEditableItem Then |
| Dim item As GridEditableItem = e.Item |
| Dim catEditor As GridDropDownListColumnEditor = item.EditManager.GetColumnEditor("OrderableCatCode") |
| For Each i As RadComboBoxItem In catEditor.ComboBoxControl.Items |
| i.ImageUrl = GetCatIcon(i.Value)''query the db to get the type and choose an icon |
| i.Text = GetCatStartString(i.Value) & i.Text''insert some '-' characters |
| Next |
| End If |
| End Sub |
and the result can be seen in the attached picture and it does not look very elegant. (because it is not a treeview)
Should I go for the template column solution or do you suggest a better one?
Thank you very much.
Safa