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

[Solved] databind - setting parameters (using lambda)

3 Answers 133 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.
quentinjs
Top achievements
Rank 1
quentinjs asked on 26 Sep 2010, 08:43 PM
Within the columns section I can use lambda espressions and assign the field ProjectId as follows:

columns.Template(o =>
{
%>
    <%= Html.ActionLink("Edit""Edit"new { id = o.ProjectId })  %>
<%

How would I do the same thing within the dataBind section, I would like to something like the following ? I have 2 examples I'm trying to do and I've struggled to figure out how to make it happen for both. 

.DataBinding(dataBinding =>
{
   dataBinding.Server().Update((ProjectController c) => c.Details( o => o.ProjectId));
   dataBinding.Server().Delete("Delete""FFFFF"), new { o => id = o.ProjectId}; }

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 27 Sep 2010, 07:57 AM
Hi quentinjs,

 This is not supported as the databinding section does not provide the bound object. The good news is that the grid automatically sends the DataKeys of the grid to the action methods specified in Update and Delete.

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
quentinjs
Top achievements
Rank 1
answered on 27 Sep 2010, 08:10 AM
Does that mean I need to pass all the potential fields in the datakeys ?  How will that affect things if I need only ProjectID for most of the cases but one special needs manyt?
0
Atanas Korchev
Telerik team
answered on 27 Sep 2010, 08:12 AM
Hi quentinjs,

 The grid sends all input fields (textboxes, dropdowns etc) when doing editing. It also submits all fields defined in the DataKeys because the developers rarely make a data key editable.

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
quentinjs
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
quentinjs
Top achievements
Rank 1
Share this question
or