Satheesh Palani

Satheesh Palani

  • NA
  • 333
  • 85.4k

Populate Value Based on Grid dropdown Selection

Mar 15 2017 3:58 AM
Hi all,
 
   I am using Kendo gird for displaying some information.the code is given below  
 
@(Html.Kendo().Grid<IPER.Models.MInvoiceLineItem>()
.Name("grid")
.Columns(Columns =>
{
Columns.Bound(m => m.InvoiceID).Hidden();
Columns.ForeignKey(m => m.ServiceID, (System.Collections.IEnumerable)ViewData["ServiceList"], "ServiceID", "ServiceName").EditorTemplateName("ServiceID");
Columns.Bound(m => m.Description).Width(100);
Columns.Bound(m => m.Quantity).Width(100);
Columns.Bound(m => m.Price).Width(80);
Columns.Bound(m => m.TaxPercentage).Width(80);
Columns.Bound(m => m.TaxAmount).Width(80);
Columns.Bound(m => m.DiscountPercentage).Width(80);
Columns.Bound(m => m.DiscountAmount).Width(80);
Columns.Bound(m => m.TotalAmount).ClientTemplate("#=calculateField(data)#");
Columns.Command(command => { command.Edit(); command.Destroy(); }).Width(250);
})
.AutoBind(true)
.ToolBar(toolbar => toolbar.Create())
.Editable(editable => editable.Mode(GridEditMode.InLine))
.Scrollable()
.HtmlAttributes(new { style = "height:280px;" })
.DataSource(dataSource => dataSource
.Ajax()
.Model(model => model.Id(m => m.InvoiceID))
.Create(update => update.Action("AddInvoiceLineItem", "InvoiceLineItem", new { InvoiceID = ViewBag.ID }))
.Read(read => read.Action("GetInvoiceLineItems", "InvoiceLineItem", new { InvoiceID = ViewBag.ID }))
.Update(update => update.Action("UpdateInvoiceLineItem", "InvoiceLineItem"))
.Destroy(delete => delete.Action("DeleteInvoiceLineItem", "InvoiceLineItem"))
.Events(e => e.Change("onChange"))
.ServerOperation(false)
)
)
 
in this if i select the service dropdown it automatically populate the service cost on the text box based on service which i select.how can i populate it.can any one try to help me.
 
                                                 Thank you..
 

Answers (1)