This is a migrated thread and some comments may be shown as answers.

[Solved] Editing trouble...

4 Answers 34 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
David
Top achievements
Rank 1
David asked on 18 Jan 2011, 06:57 PM
Hello,
  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...


4 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 19 Jan 2011, 08:34 AM
Hello David, 

Indeed we shall need additional information about the problem.

  1. What happens when you press the edit button? 
  2. What do you mean that you get no data to edit? 
  3. Does the grid enter edit mode as expected?

Ideally you could attach a short sample project which demonstrates the problem which you are experiencing.

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
David
Top achievements
Rank 1
answered on 19 Jan 2011, 06:01 PM
Ok
I will get this for you at the moment I need to work on something else first.

0
David
Top achievements
Rank 1
answered on 24 Jan 2011, 07:17 PM

What happens when you press the edit button?  
        Screen Changes to a empty grid ( ie no data in grid but grid show)

What do you mean that you get no data to edit?  
           Again just as if no data was sent to the grid

Does the grid enter edit mode as expected?
        show nothing to edit.

Hope that helps...

It just shows me a Telerik grid without data.

 
0
Rosen
Telerik team
answered on 25 Jan 2011, 08:01 AM
Hi David,

I'm afraid that the provided information is not sufficient in order to trace the cause for the described behavior. Therefore, it will be appreciated if you could provide a small sample in which it can be observed.

All the best,
Rosen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
David
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
David
Top achievements
Rank 1
Rosen
Telerik team
Share this question
or