This question is locked. New answers and comments are not allowed.
I am currently evaluating Telerik MVC for a large project, and the client requirements are very particular on the way editing records from a a grid should function. It does not appear that Telerik grid's built in editing functions are sufficient, and we will have to work around that by simply not using Telerik's Insert, Update, Delete command bindings, and just doing it ourselves. But before I write that off, I want to make sure I did not miss something.
The requirements are to be able to have an advanced grid with sorting, filtering, paging, etc., which Telerik's grid fits perfectly. The grid should also have a row buttons to open an Edit dialog which displays a custom edit template (MVC Model Template), as well as an Add New button at the top or bottom, which also opens a custom edit template for new records. Each row must also have a checkbox to select the records. A button in the header for "multiple edit" and "multiple delete" then allows for the checked records to be deleted in batch, or edited in batch--that is, a single edit popup for editing multiple records at once.
Here are the problems I'm running into. First, while Telerik works great with MVC Model Templates for the most part, there's a funny problem where it does not appear to have the model data available in all cases. Consider the following very simple Model Template (located in /Shared/EditorTemplates):
If this is invoked from the grid (using the commands.Edit() call as normal, and PopUp mode), the Window appears with First Name and Last Name filled in on the Textboxes as expected, but EmployeeID is 0! If instead of specifying @Model.EmployeeID I put it in an EditorFor (that is, @Html.EditorFor(p => p.EmployeeID) ), then I DO see the correct ID. However, I do not want EmployeeID to be in a textbox (editable or not -- I do have the ReadOnly attribute set, so it is a readonly box, but I do not want it in a box at all). It seems like the model is not really loaded until a certain point, but I cannot quite figure out what is going on to cause this issue. If I can get that working correctly, it will go a long way to solving *a lot* of my issues (for instance, I want to use Model.EmployeeType to default certain things, or hide or show certain fields, which I can only do if I can get the value of Model.EmployeeType before the form is rendered).
The bigger problem is multiple select and edit/delete. Selecting multiple records and deleting them is not too much of an issue. However, with Paging (I am using Ajax binding), I can only select the items currently displayed--if I select 4 items on page 1, and then 3 items on page 2, and click delete, only the 2 items on page 2 are deleted. I understand why this is, but our client does not, and our client wants the "best of both worlds" with Ajax paging as well as the ability to remember selections from prior pages.
Now, editing multiple records at once is the biggest challenge of all. For this, the requirement is to be able to select multiple records (checking them as previously described) and clicking an "Edit Selected Records" button that is in the header. This would then open a window with an edit view that has only a few fields in it that are designed as being "multi-editable". For instance, a "due date" might be multi-editable, allowing the user to select 20 records, click edit, and change the due-date for all selected records to the same due date. This appears to be completely outside of anything that Telerik is designed to do, and I am pretty sure we will just have to have a some custom javascript and a custom control to handle this.
Anyway, I just wanted to make sure I wasn't missing something before going on on my own direction with this. Thank you.
The requirements are to be able to have an advanced grid with sorting, filtering, paging, etc., which Telerik's grid fits perfectly. The grid should also have a row buttons to open an Edit dialog which displays a custom edit template (MVC Model Template), as well as an Add New button at the top or bottom, which also opens a custom edit template for new records. Each row must also have a checkbox to select the records. A button in the header for "multiple edit" and "multiple delete" then allows for the checked records to be deleted in batch, or edited in batch--that is, a single edit popup for editing multiple records at once.
Here are the problems I'm running into. First, while Telerik works great with MVC Model Templates for the most part, there's a funny problem where it does not appear to have the model data available in all cases. Consider the following very simple Model Template (located in /Shared/EditorTemplates):
@model AdventureWorks.Common.EmployeeModel@Html.LabelFor(p => p.EmployeeID): @Model.EmployeeID<br />@Html.LabelFor(p => p.FirstName): @Html.EditorFor(p => p.FirstName) <br />@Html.LabelFor(p => p.LastName): @Html.EditorFor(p => p.LastName) <br />If this is invoked from the grid (using the commands.Edit() call as normal, and PopUp mode), the Window appears with First Name and Last Name filled in on the Textboxes as expected, but EmployeeID is 0! If instead of specifying @Model.EmployeeID I put it in an EditorFor (that is, @Html.EditorFor(p => p.EmployeeID) ), then I DO see the correct ID. However, I do not want EmployeeID to be in a textbox (editable or not -- I do have the ReadOnly attribute set, so it is a readonly box, but I do not want it in a box at all). It seems like the model is not really loaded until a certain point, but I cannot quite figure out what is going on to cause this issue. If I can get that working correctly, it will go a long way to solving *a lot* of my issues (for instance, I want to use Model.EmployeeType to default certain things, or hide or show certain fields, which I can only do if I can get the value of Model.EmployeeType before the form is rendered).
The bigger problem is multiple select and edit/delete. Selecting multiple records and deleting them is not too much of an issue. However, with Paging (I am using Ajax binding), I can only select the items currently displayed--if I select 4 items on page 1, and then 3 items on page 2, and click delete, only the 2 items on page 2 are deleted. I understand why this is, but our client does not, and our client wants the "best of both worlds" with Ajax paging as well as the ability to remember selections from prior pages.
Now, editing multiple records at once is the biggest challenge of all. For this, the requirement is to be able to select multiple records (checking them as previously described) and clicking an "Edit Selected Records" button that is in the header. This would then open a window with an edit view that has only a few fields in it that are designed as being "multi-editable". For instance, a "due date" might be multi-editable, allowing the user to select 20 records, click edit, and change the due-date for all selected records to the same due date. This appears to be completely outside of anything that Telerik is designed to do, and I am pretty sure we will just have to have a some custom javascript and a custom control to handle this.
Anyway, I just wanted to make sure I wasn't missing something before going on on my own direction with this. Thank you.