web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

Dynamics CRM 2011 Portal Development – CrmEntityDataSource

Zhongchen Zhou Profile Picture Zhongchen Zhou 681

Dynamics CRM 2011 Portal Development

CrmEntityDataSource data source control expose a property “DataItem” of type object and make it available for other controls to bind to, without requiring code. It only supports retrieving value from CrmEntityDataSource.DataItem property.

If CrmSiteMapNode is assigned as the value for DataItem property, then the return value will be
new Entity[] { CrmSiteMapNode.Entity },
otherwise it will be
new object[] { CrmEntityDataSource.DataItem }.

DataItem property can be set in the .aspx markup by using ASP.NET Expressions/ExpressionBuilder (e.g. CrmSiteMap Expression).

More information regarding to ASP.NET expression can be found ASP.NET Expressions Overview  and ExpressionBuilder Class.

DataItem property can also be set in the .cs code behind.

Example:


<crm:CrmEntityDataSource ID="CrmEntityDataSource1" runat="server" DataItem='<%$ CrmSiteMap: Current %>'>
 </crm:CrmEntityDataSource>
 <asp:GridView ID="GridView1" runat="server" DataSourceID="CrmEntityDataSource1">
 </asp:GridView>

Result:


This was originally posted here.

Comments

*This post is locked for comments