1. My requirements is to display in a grid only 4 columns of data.
(They happen to be SKU, plant name, form type and location – they are all strings – the row object does have an id but would be hidden from the user) When the user clicks to the expand item, the requirements is to send a single argument to a web service ( form type : string ) the service does a calculation using this argument and returns back a single object with pricing details that has 4 properties. The prototype can be seen at http://pannebakkerupload.azurewebsites.net/readBatch click select for the detail.
|
function detailDataBound(args) {
args.cancel = true; // prevented default actions
var OrderID = args.data.OrderID;
var url = "/GridEdit/Edit?OrderID=" + OrderID; // Passed required value to link
location.assign(url);
} |
|
[EditController.cs]
public ActionResult Edit(int OrderID)
{
// customize your code here..
if (OrderID != 0)
{
BindDataSource();
IEnumerable DataSource = order;
Dictionary<string, string> dictionary = new Dictionary<string, string>();
var data = order.Where(or => or.OrderID == OrderID).FirstOrDefault();
return View(data);
}
else if (OrderID == 0)
return View();
return View();
} |