This is a migrated thread and some comments may be shown as answers.
Is it possible to use multiple model valueswhen using Format on a columns?
1 Answer 20 Views
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 19 Aug 2010, 03:21 PM
I am using Ajax data binding therefore cannot use the column template method. I have the column format working fine when picking up a single model value. Example;

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

I also need to access a second model property if possible I am trying to do something like this;

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

As you can see I want to append another Model value to my actionlink controller name as this is dynamically processed to decide which controller to use.

Is this possible?  Can I use more thatn one model value in column format?

1 Answer, 1 is accepted

Sort by
0
Peter Felice
Top achievements
Rank 1
answered on 25 Dec 2010, 03:34 PM
Just curious if the OP or anyone else has a solution for this as I am getting stumped on this exact issue?

Thanks!
Tags
Grid
Asked by
Andy McShane
Top achievements
Rank 1
Answers by
Peter Felice
Top achievements
Rank 1
Share this question
or