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
340
EditorCombo in Grid with ItemTemplate
posted

I haven't found a post that describes my problem, so sorry in advanced if there is already one.

I have a simple grid that displays a couple of values. One of these values is a path to an icon. By using a template for that column, not the path but the icon itself is shown.

.Columns(c =>
{
   c.For(x => x.Id).HeaderText("ID").Width("5%").DataType("number");
   c.For(x => x.Name).HeaderText("Company").Width("20%");
   c.For(x => x.ShortName).HeaderText("Abbrivation").Width("10%");
   c.For(x => x.DisplayIcon).HeaderText("Icon").Width("10%").Template("<img src='${DisplayIcon}' alt='icon' />");
})

When in editmode, the field icon is a combo from where the user can select a different icon. The dropdown only shows the text, but I also want to use an image so they can see what the icon looks like. With a regular igCombo I can use an itemtemplate to add an <img /> element. But I haven't found out how to do this for an EditoCombo inside a grid.

this is the feature i've added

f.Updating().EnableAddRow(false).ColumnSettings(cs =>
{
 cs.ColumnSetting().ColumnKey("Id").ReadOnly(true);
 cs.ColumnSetting().ColumnKey("DisplayIcon").EditorType(ColumnEditorType.Combo).ComboEditorOptions(co => co.DataSource(ViewBag.SelectableIcons).ValueKey("ImageUrl").TextKey("Name").Mode(ComboMode.DropDown));
});

Is this even possible?