TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
sreenivasa k
882
893
34.6k
Kendo dropdownlist & kendo grid binding & refresh with json
Apr 3 2015 11:53 PM
**1. when page load, all products ids bind to dropdownlist. when user select a product id from dropdownlist and click on Add button then corresponding product details would add to grid and same product id delete from the dropdown list.
2. When user remove a product from grid (by using remove link) then corresponding product id would added back to dropdownlist.**
**Model:**
public class ProductModel
{
public List<long>ProdIds {get;set;} //list of product id's - bind to kendo dropdownlist
public List<Products> Products{get;set;}//list of products bind to kendo grid
}
**Controller:**
public JsonResult RefreshDatata(long Id)
{
var model = new ProductModel();
_prodIds = model.ProdIds.add(id);
_products = model.Products.Removeat(Products.FirstOrDefault(x=>x.ProductId==id))
return Json(new {ProdIds:_products,Products:_Prodcusts},JasonBehaviour.AllowGet());
}
**View(.cshtml)**
$.ajax({
type: "POST",
url: "RefreshDatata/Product",
data:
{
id: id,
},
success: function(result)
{
**//how to bind kendo grid and refresh from json result (_prodIds)**
**//how to bind dropdownlist and refresh from json result (_Prodcusts)**
}
});
Reply
Answers (
1
)
Show spinner when ajax async is set to false
How to fetch image from database using jquery