This is a migrated thread and some comments may be shown as answers.

[Solved] ForeignKey "DropDownList" filled with Ajax-Binding

3 Answers 78 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Iwhp
Top achievements
Rank 1
Iwhp asked on 29 Nov 2011, 09:18 PM
Case A)
I'd like to use the ForeignKey method of the Grid control. But instead of providing the List of values during the creation of the view, i'd like to get the values with Ajax-Binding. Is this possible?

Case B)
I do have the requirement, that the values in the list are not the same for all the lines in the grid. So one line may only get a list containing 1 to 5, and the other line may only get the list 4 to 8. This is depending on a value stored in the line. I would like to get it working with Ajax-Binding, but I could also not figure it out, how one can to it with Server-Binding. Is this possible with ForeignKey, or is there another way, like templating?

Thankx, Harry

3 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 30 Nov 2011, 11:12 AM
Hello Harry Pfleger,

I'm afraid that ForeignKey column does not support such functionality. However, you may use editor templates approach, as shown in this online demo, to implement ajax binding and additional logic  for the DropDownList. I have attached a sample which demonstrates a basic implementation.

Regards,
Rosen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Iwhp
Top achievements
Rank 1
answered on 30 Nov 2011, 04:05 PM
Hello Rosen

thank you very much for the help and the example. I am almost there. What's missing is the Update (this is also not available in the sample).

If you run the sample, click on the edit button, change the category, then click on the update button, the selected category is not shown in the list. There seems to be a missing piece. Any ideas?

Thankx, Harry
0
Rosen
Telerik team
answered on 30 Nov 2011, 04:20 PM
Hello Harry Pfleger,

Indeed, the update functionality is omitted in order the sample to be more focused on the requested functionality of DropDownList. If you refer to the online demo I have mentioned in my previous message you will find a sample implementation of the update action.

Regards,
Rosen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
Tags
Grid
Asked by
Iwhp
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Iwhp
Top achievements
Rank 1
Share this question
or