This question is locked. New answers and comments are not allowed.
Hello,
I have the following controller code.
and the view :
I am using MVC 2
I get the data in the grid find but when i click the edit button I get no data to edit at all. I just want them to be able to edit the sort order all other fields are not editiable.
Please ask additional questions as needed, I am not sure I have explained it well enough...
I have the following controller code.
public ActionResult Index(String id) { IQueryable<productlist> PinCat = null; if (!string.IsNullOrEmpty(id)) { PinCat = (from item in storedb.Products_In_Category where item.Product_Categories.Category_Name == id select new productlist { Cat_Guid = item.Cat_GUID, Dbman_descrition = item.Product.Product_Description, Manufacturer_Name = item.Product.Manufacturers_Table.Manufacturer_Name, Pattern_Name = item.Product.Patterns_Table.Pattern_Name, pre = item.Product.PRE, Product_GUID = item.Product.Product_GUID, Product_key = item.Product.Product_Key, Type_name = item.Product.Types_Table.Type_Name, sortorder = item.Product.Item_Sort_Order, qty = item.Product.Quantity, Retail_Price = item.Product.Retail_Price } ).AsQueryable(); ViewData["id"] = id ?? string.Empty; } return View(PinCat); }and the view :
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<ProductSystem.Models.productlist>>" %> <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> Index </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <h2>Items in <%: ViewData["id"] %> category</h2> <%= Html.Telerik().Grid(Model) .Name("grid name") .DataKeys(keys => keys.Add(c => c.Product_GUID)) .DataBinding(dataBinding => dataBinding .Ajax() .Update("Update", "Examples", new { id2 = ViewData["id"] }) ) .Columns(columns => { columns.Bound(o => o.Product_key).Title("Part #").ReadOnly(); columns.Bound(o => o.Dbman_descrition).ReadOnly(); columns.Bound(o => o.Pattern_Name).ReadOnly(); columns.Bound(o => o.Manufacturer_Name).ReadOnly(); columns.Bound(o => o.pre).ReadOnly(); columns.Bound(o => o.qty).ReadOnly(); columns.Bound(o => o.Retail_Price).ReadOnly(); columns.Bound(o => o.sortorder); columns.Command(commands => { commands.Edit(); }).Width(200); }) .Pageable().Filterable().Sortable() %> </asp:Content> <asp:Content ID="Content3" ContentPlaceHolderID="Head" runat="server"> </asp:Content> I am using MVC 2
I get the data in the grid find but when i click the edit button I get no data to edit at all. I just want them to be able to edit the sort order all other fields are not editiable.
Please ask additional questions as needed, I am not sure I have explained it well enough...