Hi,
I have a combo box in edit mode of a telerik grid, but I am getting null value for selected value on onchange event. Please see code below
partail view:
Thanks..
I have a combo box in edit mode of a telerik grid, but I am getting null value for selected value on onchange event. Please see code below
partail view:
Html.Telerik().ComboBox().Name("StyleImage").ClientEvents(events => events
.OnChange("onChange")
)
here is js code
function onChange(e) {
alert(e.value);
}
here is grid onedit
function Grid_onEdit(e) {
var styleImage = $('#StyleImage').data('tComboBox');
$.getJSON(appUrl("Controller/Action"),
{ styleId: styleValue },
function (data) {
styleImage.dataBind(data.value);
styleImage.value(e.dataItem['DefaultImage']);
}
);
}
}
Here is controller code
public JsonResult Action(string styleId)
{
List<
string
> images=new List<
string
>();
return Json(new { success = true, value = images }, JsonRequestBehavior.AllowGet);
}
this is how I am seeing rendered code for combo box
<div class="t-animation-container" style="width: 150px; height: 214px; position: absolute; z-index: 10002; top: 382.817px; left: 599.733px; display: none;">
<div class="t-popup t-group" style="display: block; height: auto; overflow: auto; width: 148px; margin-top: -214px;">
<ul class="t-reset">
<li class="t-item" unselectable="on">GWTUTU2-BRMLL</li>
<li class="t-item" unselectable="on">GWTUTU2-PIMLL</li>
<li class="t-item" unselectable="on">GWTUTU2-SILTX</li>
<li class="t-item t-state-selected" unselectable="on">GWTUTU2-BLMLL</li>
<li class="t-item" unselectable="on">GWTUTU2-YELLL</li>
<li class="t-item" unselectable="on">GWTUTU2-MPILL</li>
<li class="t-item" unselectable="on">GWTUTU2-DPILL</li>
<li class="t-item" unselectable="on">GWTUTU2-BUMLL</li>
<li class="t-item" unselectable="on">GWTUTU2-BLKLL</li>
<li class="t-item" unselectable="on">GWTUTU2-DGRLL</li>
</ul>
</div>
</div>
Thanks..