ASP.NET MVC Controls > Getting Started > Scaffolding in ASP.NET MVC Controls > Insert MVC Control |
The Insert C1 MVC Control option allows you to easily add a fully functional control in the view code of an existing application. The dialog can be invoked by right-clicking the design area of a view. Note that a view must be focused in order to invoke the AddScaffold dialog.
Complete the following steps to add a new control in the view code using Scaffolding.
In the General tab, specify the model details as follows:
Razor |
Copy Code
|
---|---|
public class TreeViewController : Controller { TreeViewSample.Models.C1NWindEntities db = new C1NWindEntities(); // GET: TreeView public ActionResult Index() { ViewBag.SalesByQuarters = db.SalesByQuarters; return View(Property.GetData()); } } |
HTML |
Copy Code
|
---|---|
@using TreeViewSample.Models @model Property[] @(Html.C1().FlexRadar<SalesByQuarter>() .BindingX("QuarterMonth") .Series(csbsb => { csbsb.Add(); }) .Binding("ProductX") .Bind(cvsb => cvsb.Bind((IEnumerable<SalesByQuarter>)ViewBag.SalesByQuarters)) .Height("300px") .Id("flexRadar4")) @(Html.C1().TreeView() .Bind(Model) .DisplayMemberPath("Header") .ChildItemsPath("Items")) |