I would like to see the complete functional code for the "Editing custom Editor" for Grid ,because something is missing there(in the online example).
there is a line:
I would like to add inside the grid also the Category of the product(which means a Dropdownlist with all the categories), just like in the example,but the code is for Order-Employee case.either way is still missing something there that template and how is bound to that list of that FK in our case, CategoryID.
Or again,if i can get an complete functional example for MVC(cshtml file and the code from the controller) with Northwind database just like in the online example.
Again i mention that in the \Program files(x86)\Telerik\Kendo UI for ASP.MVC there is NO \Examples folder with the examples,it would be nice to have all those examples,if they work.
thanks in advance.
there is a line:
columns.Bound(p => p.Employee).ClientTemplate("#=Employee.EmployeeName#");but who is ("#=Employee.employeeName") and also is correct that syntax? .i supose it should be a template.but where it is?
I would like to add inside the grid also the Category of the product(which means a Dropdownlist with all the categories), just like in the example,but the code is for Order-Employee case.either way is still missing something there that template and how is bound to that list of that FK in our case, CategoryID.
Or again,if i can get an complete functional example for MVC(cshtml file and the code from the controller) with Northwind database just like in the online example.
Again i mention that in the \Program files(x86)\Telerik\Kendo UI for ASP.MVC there is NO \Examples folder with the examples,it would be nice to have all those examples,if they work.
thanks in advance.
6 Answers, 1 is accepted
0
Hi Daniel,
ClientEmployee partial view:
Kind Regards,
Vladimir Iliev
the Telerik team
Basically the offline examples which contains complete functional demo of "Grid Editing Custom Editor"
are located in different folder from the one that you mention:
- ..\Telerik\Kendo UI for ASP.NET MVC %VERSION%\wrappers\aspnetmvc\Examples
Also please note that the ClientTemplate method contains inline template and the Editor template is defined in the model using the UIHint attribute which contains the PartialView name:
Model:
[UIHint(
"ClientEmployee"
), Required]
public
ClientEmployeeViewModel Employee
{
get
;
set
;
}
ClientEmployee partial view:
@(Html.Kendo().DropDownList()
.Name(
"Employee"
)
.DataValueField(
"EmployeeID"
)
.DataTextField(
"EmployeeName"
)
.BindTo((System.Collections.IEnumerable)ViewData[
"employees"
])
)
Vladimir Iliev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Daniel
Top achievements
Rank 1
answered on 19 Dec 2012, 07:43 AM
Hello,i managed to make it work the example,but with the local example installed from telerik control panel,the key was the clientTemplate was pointing to an EditorTemplate,which in the zipped example(sent at dropdownlist post) wasn't there,and i didn't understand how the view knows who is the employee from ClientTemplate.
Many thanks.
Many thanks.
0
Hi Daniel,
Vladimir Iliev
the Telerik team
Please note that the ClientTemplate sets the template for that column and currently it renders property from the model.
Vladimir Iliev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Daniel Knoll
Top achievements
Rank 1
answered on 02 Jan 2013, 01:54 PM
Hi,
I've also noticed the missing example on the online demo.
So please provide the ASP.NET MVC Code for populating a grid like it is shown in the demo. Currently the ASP.NET MVC Code shows how to populate a grid with Employee and ShipAddress, but the example shown is about Products and Category.
In particular I'm interested in how to load the Categories column like in the HTML version with a provided datasource. Currently I dont have the Method or Property "editor" like in the HTML version, where I can provide a Javascript Function to create the DropDownList.
In my scenario I need to populate a Dropdown (Foreign Key) in respect of a current selected filter, which is a DropDownList on the page above the Grid.
Greets
I've also noticed the missing example on the online demo.
So please provide the ASP.NET MVC Code for populating a grid like it is shown in the demo. Currently the ASP.NET MVC Code shows how to populate a grid with Employee and ShipAddress, but the example shown is about Products and Category.
In particular I'm interested in how to load the Categories column like in the HTML version with a provided datasource. Currently I dont have the Method or Property "editor" like in the HTML version, where I can provide a Javascript Function to create the DropDownList.
In my scenario I need to populate a Dropdown (Foreign Key) in respect of a current selected filter, which is a DropDownList on the page above the Grid.
Greets
0
Hi,
Daniel
the Telerik team
The approach to define an editor template is different in MVC. Please check this documentation topic which provides information on this matter.
As for filtering the dropdown based on an external input - you could use the following approaches:
- Use the Grid edit event to find the dropdown and filter it through its dataSource filter method
- Use remote binding for the dataSource and pass the value from the other dropdown through the DataSource Data function.
Daniel
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Daniel Knoll
Top achievements
Rank 1
answered on 07 Jan 2013, 10:31 AM
Hi,
thanks for your answer.
In the meantime, I've implemented following solution:
I created a template for the Navigation Property like in the tutorial you provided. In this template I set the DataSource of the DropDownList to my Remote DataSource and I pass the name of the JavaScript Function with the Data Property. This function exists in the page, where the Grid is shown. The control finds this function at runtime and passes the right data.
Maybe thats not the best solution, because I cannot ensure that the JavaScript Function exists, but it's definetly easier to implement.
Greets
thanks for your answer.
In the meantime, I've implemented following solution:
I created a template for the Navigation Property like in the tutorial you provided. In this template I set the DataSource of the DropDownList to my Remote DataSource and I pass the name of the JavaScript Function with the Data Property. This function exists in the page, where the Grid is shown. The control finds this function at runtime and passes the right data.
Maybe thats not the best solution, because I cannot ensure that the JavaScript Function exists, but it's definetly easier to implement.
Greets