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

Pass multiple values in columns.bound

2 Answers 61 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.
Andy McShane
Top achievements
Rank 1
Andy McShane asked on 18 Aug 2010, 05:30 PM
Hi all, please consider the following code;

columns.Bound(o => o.UserId ).Format(Html.ActionLink(ViewData["txtEdit"].ToString(), "Edit", "ServiceUser",
                                                      new { id = "{0}", height = 550, width = 900, modal = "true" },
                                                      new { @class = "t-link action-edit thickbox" })).Title(" ").Encoded(false).Width(25)
                                                                                                       .Sortable(false)
                                                                                                       .Filterable(false)
                                                                                                       .HtmlAttributes(new { @style = "text-align:center" });

Is it possible for me to pass multiple values in a column.Bound method such as the above? As it is I am passing the 'UserId' and using 'Format' to build my MVC action link. I need to also pass additional parameters i.e. something like 'o => o.UserId, o.treatmentId'.
Can anyone guide me on this, many thanks.

2 Answers, 1 is accepted

Sort by
0
Andy McShane
Top achievements
Rank 1
answered on 19 Aug 2010, 10:10 AM
This may help clarify what I am trying to do a little better. Still based upon the code above what I really need to do is to be able to use a parameter to build the name of my controller in the actionlink. for example, in the above example I have an action called 'Edit' and a controller called 'ServiceUser'. I need to be able to append the value of a parameter to my controller name as follows 'ServiceUser_' + o.treatmentId. How can I access additional values from my model in this way?
0
Andy McShane
Top achievements
Rank 1
answered on 11 Jan 2011, 03:08 PM
Anybody? :-(
Tags
Grid
Asked by
Andy McShane
Top achievements
Rank 1
Answers by
Andy McShane
Top achievements
Rank 1
Share this question
or