This question is locked. New answers and comments are not allowed.
Hi,
I'm having problems editing a Grid when it's stored in a TabStrip. I first created the Grids as part of regular pages and they work fine with pop-up editing. The problem arises when I want to Edit the Grid in a TabStrip - this time the currently selected item in Dropdowns is always the first item and not the actual value.
This is the grid view that I have in ascx file for the TabStrip
When I have this in an aspx file (where it works) I have the following Javazscript alongside it
Putting this in the ascx file has no effect and I've also tried putting it in the parent index.aspx of the Tabstrip but to no avail either. Is there some change of syntax in the Javascript required when using the Grid within the Tabstrip?
Any help appreciated.....worst case I can revert to using the pages but ideally would like to use the TabStrip and partial views.
Thanks!
I'm having problems editing a Grid when it's stored in a TabStrip. I first created the Grids as part of regular pages and they work fine with pop-up editing. The problem arises when I want to Edit the Grid in a TabStrip - this time the currently selected item in Dropdowns is always the first item and not the actual value.
This is the grid view that I have in ascx file for the TabStrip
<% GridEditMode mode = (GridEditMode)ViewData["mode"]; GridButtonType type = (GridButtonType)ViewData["type"];%><%= Html.Telerik().Grid(Model) .Name("ProductsGrid") .DataKeys(keys => { keys.Add(p => p.ProductID); }) .ToolBar(commands => commands.Insert().ButtonType(type).ImageHtmlAttributes(new { style = "margin-left:0" })) .Columns(columns => { columns.Bound(o => o.ProductID); columns.Bound(o => o.ItemID); columns.Bound(o => o.ISBN); columns.Bound(o => o.MaterialCode); columns.Bound(o => o.MaterialStatus); columns.Command(commands => { commands.Edit(); commands.Delete(); }).Width(200); }) .DataBinding(settings => settings.Ajax() .Select("_AjaxSelectProductEditing", "Admin") .Insert("_AjaxInsertProductEditing", "Admin") .Update("_AjaxSaveProductEditing", "Admin") .Delete("_AjaxDeleteProductEditing", "Admin")) .Editable(editing => editing.Mode(mode)) .Pageable() .Sortable()%>When I have this in an aspx file (where it works) I have the following Javazscript alongside it
<script type="text/javascript"> function onEdit(e) { $(e.form).find('#Component').data('tDropDownList').select(function (dataItem) { return dataItem.Value == e.dataItem['Component']; }); $(e.form).find('#Project').data('tDropDownList').select(function (dataItem) { return dataItem.Value == e.dataItem['Project']; }); $(e.form).find('#Language').data('tDropDownList').select(function (dataItem) { return dataItem.Text == e.dataItem['Language']; }); }</script>Putting this in the ascx file has no effect and I've also tried putting it in the parent index.aspx of the Tabstrip but to no avail either. Is there some change of syntax in the Javascript required when using the Grid within the Tabstrip?
Any help appreciated.....worst case I can revert to using the pages but ideally would like to use the TabStrip and partial views.
Thanks!