当我将客户端模板用于列时,我在项目中使用 Telerik 控件,但数据出现在客户端模板中,但在按下提交按钮时未保存,它显示为空模板。下面是我的代码
@(Html.Telerik().Grid<edairy.Models.ReceiptsEntry.mst_stock_dtl>()
.Name("gdStkDetails")
.ToolBar(commands =>{ commands.Insert();
commands.SubmitChanges();
} )
.DataKeys(keys => keys.Add(c => c.Trans_No))
.Pageable(paging =>
paging.PageSize(10)
.Style(GridPagerStyles.NextPreviousAndNumeric)
.Position(GridPagerPosition.Bottom))
.Sortable(sorting => sorting
.SortMode(GridSortMode.MultipleColumn))
.ClientEvents(e => e.OnDataBound("onDataBound"))
.DataBinding(databing => databing.Ajax()
.Select("SelectStock", "ReceiptsEntry")
//.Insert("AddStock", "ReceiptsEntry")
.Update("Editproduct", "ReceiptsEntry")
//.Delete("DeleteStock", "ReceiptsEntry")
)
.Columns(columns =>
{
columns.Bound(c => c.Trans_No).Title("Transaction No").Width(100);
columns.Bound(c => c.Product_cd).Title("Product Code").EditorTemplateName("GrdDropdown").Width(150);
columns.Bound(c => c.Prouduc_desc).Title("Product Desc").EditorTemplateName("text").Width(100);
columns.Bound(c => c.Prouduc_desc).Title("Product Desc").ClientTemplate("<input type='text' id='text' name='ProductDesc' /> ").Width(100);
columns.Bound(c => c.Receipt_Quantity).Title("Receipt Qty").Width(150);
columns.Command(commands =>
{
// commands.Edit();
commands.Delete();
});
})
.Editable(editing => editing.Mode(GridEditMode.InCell))
//.Editable(editing => editing.Mode(GridEditMode.PopUp))
)
</text>);
})
.SelectedIndex(0)
.Render();
}
请在这个问题上帮助我。在此先感谢。