Hello,
I am using 'MVC2' and 'Telerik 2010.1.416'.When I click on edit button it gives me a update and cancel button,where I can update only one row in which I made the change.I want that row to be displayed as a popup
as shown in the link where the Edit Mode is 'PopUp'
http://demos.telerik.com/aspnet-mvc/Grid/EditingServerSide/1?mode=PopUp&type=Text&theme=vista&Grid-mode=edit. But in my view below I am getting the error at ".Editable(editing => editing.Mode(mode))"
which is not allowing me to set the edit mode as 'popup'.Can we acheive this PopUp functionality only in MVC3 Framework and Telerik 2011?.Also I am even unable to do "Batch Editing" for the grid where we update all the changes made in the grid.Can this Batch Editing functionality can also be acheived only in MVC3 Framework and Telerik 2011?.Any suggestions will be greately appreciated...
Thanks,
Satish.
View:
<%
@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<SLIC.Models.SLICAccountModel>" %>
<%
@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<
asp:Content ID="ContentTitle" ContentPlaceHolderID="TitleContent" runat="server">
<%
: ViewData["applicationName"] %>
- Details-
<%
= Model.FRN %>
</
asp:Content>
<
asp:Content ID="ContentHeader" ContentPlaceHolderID="HeaderContent" runat="server">
</
asp:Content>
<
asp:Content ID="ContentPage" ContentPlaceHolderID="PageContent" runat="server">
<div id="MenuPage">
<span id="PageTitle">OCC List
<%
: Model.FRN %>
</span>
<hr />
<br />
<div class="Center">
<%
= Html.ValidationSummary() %>
<% if (TempData["formMessage"] != null && TempData["formMessage"].ToString() != "")
{%>
<span class="RedBold"> <%: TempData["formMessage"].ToString() %> </span>
<br />
<br />
<%}%>
<span><strong>OCCList</strong></span>
<br />
</div>
<br />
<%
-- <form name="OCC" method="post" onclick = "Update" action="<%= Url.Action("Update", new{ FRN = Model.FRN})%>">--%>
<tr>
<td class="Left">
<% Html.Telerik().Grid(Model.AppliedOCC)
.Name("AppliedOCC")
.Footer(false)
.DataKeys(dataKeys => dataKeys.Add(key => key.FRN))
.DataBinding(dataBinding => dataBinding.Server().Select("AppliedOCC", "SLICAccount", new { FRN = Model.FRN, mode = GridEditMode.PopUp }).Update("Update", "SLICAccount", new { FRN = Model.FRN, mode = GridEditMode.PopUp }))
.Columns(columns =>
{
columns.Bound(sr => sr.OCC_ID).Title("OCC_ID").HeaderHtmlAttributes(
new { style = "font-weight: bold;" }).Width(100);
columns.Bound(sr => sr.OCC_DATE).Title("OCC Date").Format("{0:MM/dd/yyyy}").HeaderHtmlAttributes(
new { style = "font-weight: bold;" }).Width(100);
columns.Bound(sr => sr.PROD_ID).Title("Product I.D").HeaderHtmlAttributes(
new { style = "font-weight: bold;" }).Width(100);
columns.Bound(sr => sr.CUST_ID).Title("Customer I.D").HeaderHtmlAttributes(
new { style = "font-weight: bold;" }).Width(100);
columns.Bound(sr => sr.ACCT_NO).Title("Account Number").HeaderHtmlAttributes(
new { style = "font-weight: bold;" }).Width(100);
columns.Bound(sr => sr.MOBIL_PHONE).Title("MTN").HeaderHtmlAttributes(
new { style = "font-weight: bold;" }).Width(100);
columns.Bound(sr => sr.SPI_MONTH).Title("SPI Month").HeaderHtmlAttributes(
new { style = "font-weight: bold;" }).Width(80);
columns.Bound(sr => sr.EFF_DATE).Title("Effective Date").Format("{0:MM/dd/yyyy}").HeaderHtmlAttributes(
new { style = "font-weight: bold;" }).Width(100);
columns.Bound(sr => sr.BILLING_MONTH).Title("Billing Month").Format("{0:MM/dd/yyyy}").HeaderHtmlAttributes(
new { style = "font-weight: bold;" }).Width(100);
columns.Bound(sr => sr.SLC_DISCOUNT).Title("Discount").HeaderHtmlAttributes(
new { style = "font-weight: bold;" }).Width(70);
columns.Bound(sr => sr.USERID).Title("UserI.D").HeaderHtmlAttributes(
new { style = "font-weight: bold;" }).Width(70);
columns.Bound(sr => sr.PROCESSED).Title("Processed").HeaderHtmlAttributes(
new { style = "font-weight: bold;" }).Width(85);
columns.Bound(sr => sr.NOTE).Title("Notes").HeaderHtmlAttributes(
new { style = "font-weight: bold;" }).Width(100);
columns.Command(commands => { commands.Edit(); }).Width(200);
; %>
<%})
.Editable(editing => editing.Mode(mode)) //I am getting the error here
.Filterable()
.Selectable()
</td>
</tr>
</div>
</asp:Content>
<asp:Content ID="ContentFooter" ContentPlaceHolderID="FooterContent" runat="server">
</asp:Content>
Controller:
[RequiresPermission(RequiredPermission = "Viewer")]
[GridAction]
public ActionResult AppliedOCC(string FRN)
{
SLICAccountModel _SLICAccountModel = new SLICAccountModel(FRN) { FormMode = "Edit" };
SetViewData(FRN);
_SLICAccountModel.GetAppliedOCC(FRN);
SLICRepository _SLICRepository = new SLICRepository();
//return View("OCCList", new ViewDataDictionary(_SLICAccountModel.AppliedOCC));
return View("OCCList", _SLICAccountModel);
}
public ActionResult Update(string FRN, IEnumerable<SLICAccountModel> _SLICAccountModel1)
{
SLICAccountModel _SLICAccountModel = new SLICAccountModel();
string SPI_MONTH = Request.Form["SPI_MONTH"];
string OCC_ID = Request.Form["OCC_ID"];
string UpdateOCCList = _SLICAccountModel.UpdateOCCList(FRN, SPI_MONTH, OCC_ID);
if (UpdateOCCList == "Success")
{
TempData["formMessage"] = "Update Success";
}
_SLICAccountModel.GetAppliedOCC(FRN);
return View("OCCList",_SLICAccountModel);
}
Model:
public List<SL_FRN_OCC> GetAppliedOCC(string _frn)
{
AppliedOCC = _SLICRepository.GetAppliedOCC(_frn).ToList();
return AppliedOCC;
}
public string UpdateOCCList(string FRN, string SPI_MONTH, string OCC_ID)
{
string UpdateOCCList = _SLICRepository.UpdateOCCList(FRN, SPI_MONTH, OCC_ID);
return UpdateOCCList;
}
Repository:
internal string UpdateOCCList(string FRN, string SPI_MONTH,string OCC_ID)
{
try
{
int OCC_IDVALUE = Convert.ToInt32(OCC_ID);
SL_FRN_OCC OCCListDetails = (from sql in _SLICEntities.SL_FRN_OCC
where sql.FRN == FRN && sql.OCC_ID == OCC_IDVALUE
select sql).FirstOrDefault();
int SPI_MONTH_VALUE = Convert.ToInt32(SPI_MONTH);
if (OCCListDetails != null)
{
OCCListDetails.SPI_MONTH = SPI_MONTH_VALUE;
}
_SLICEntities.SaveChanges();
return "Success";
}
catch (Exception e)
{
throw new Exception("DB:ERROR => Models->Repository->SLICRepository->UpdateOCCList()", e);
}
}
internal IList<SL_FRN_OCC> GetAppliedOCC(string FRN)
{
try
{
List<SL_FRN_OCC> AppliedOCC = (from sql in _SLICEntities.SL_FRN_OCC
where sql.FRN == FRN
orderby sql.FRN
select sql).ToList();
return AppliedOCC;
}
catch (Exception e)
{
throw new Exception("DB:ERROR => Models->Repository->SLICRepository->GetAppliedOCC", e);
}
}