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

[Solved] getting an error on the mapping

1 Answer 108 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
georges
Top achievements
Rank 1
georges asked on 16 Dec 2010, 11:25 PM

@

 

using Telerik.Web.Mvc.UI;
@
using TPRO.Models

 

 

@{

View.Title =

 

"Home Page";

 

Layout =

 

"~/Views/Shared/_Layout.cshtml";

 

 

}

<

 

 

table width="100%" cellpadding="0" border="0" cellspacing="0">

 

 

 

 

<tr valign="top" align="left"><td style="background:#FFF8C6">

 

@(

 

Html.Telerik().PanelBar().Name(

 

"PanelBar")

 

.HtmlAttributes(

 

new { style = "width: 300px;" })

 

.BindTo(Model, mappings =>

{

mappings.For<

 

GroupsModels>

 

(binding => binding.ItemDataBound((item, category) =>

{ item.Text = category.Group; })

);

})

 

)

 

 

</td><td align="right" style="width:300px"><img alt="" src="../../images/logo.jpg" /></td></tr>

 

 

 

<tr style="background:#000000"><td align="center" colspan="2"><h2 style="color:White">Welcome to GDOT Transportation Projects</h2></td></tr>

 

</

 

 

table>

 

error is Error 
 Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type c:\validation\MVCtpro\Views\Home\frmPanel2.cshtml 

it is driving me  nuts

thanks

1 Answer, 1 is accepted

Sort by
0
Kevin Burandt
Top achievements
Rank 1
answered on 16 Mar 2011, 05:49 PM
I ran into something similar.  You might want to try casting category.Group to string.

old
{ item.Text = category.Group; })

new
{ item.Text = (string) category.Group; })

Kevin
Tags
PanelBar
Asked by
georges
Top achievements
Rank 1
Answers by
Kevin Burandt
Top achievements
Rank 1
Share this question
or