THANKS!!! Your sample was exactly what I needed. I guess I can't use a
Dictionary<int,string> and need a Dictionary<string,string>.
I'm a little baffled why, but this solves my problem.
Really appreciate the help.
Best Regards,
Paul
On Jun 10, 10:29 am, Jeremy Skinner <
jer...@jeremyskinner.co.uk>
wrote:
> I can't reproduce this. I have a collection of Person objects with a Gender
> property (M/F) and the following test code:
>
> <% var dictionary = new Dictionary<string, string> { { "M", "Male" }, { "F",
> "Female" } }; %>
> <%= Html.Grid<Person>(Model).Columns(column => {
> column.For(x => dictionary[x.Gender]);
>
> }) %>
>
> ...and this works correctly. The closure will correctly capture the
> dictionary variable.
>
> The error that you're getting looks like you're passing a lambda
> expression to somewhere that is expecting a string.
> If you like, feel free to put together a sample project that reproduces the
> issue and send it to me. I'd be happy to look at it.
>
> Jeremy
>
> 2009/6/10 ppearcy <
ppea...@gmail.com>