0
名的动态列表我在GridView下面的代码片段:显示在工具提示
<ItemTemplate>
<asp:Label
ID="lblRecipientsCount"
runat="server"
Text='<%#String.Join(",",((Share.Service.Message)Container.DataItem).Recipients.Count()) %>'
ToolTip='<%#String.Join(","((Share.Service.Message)Container.DataItem).Recipients.ToString()) %>'>
</asp:Label>
</ItemTemplate>
的计数收件人正常工作数据绑定标签。当我将第二个绑定标签添加到工具提示时,工具提示将显示Share.Service.Person []。
我的最终目标是让工具提示显示逗号分隔的收件人姓名列表。
任何帮助表示赞赏。
On Count,我得到了:属性'System.Array.Count'不能在这个上下文中使用,因为get访问器是不可访问的。 –
@Rex_C:如果是数组(编辑),则使用'Length'或'Count()'。 –
现在,它在Select Select上抛出一个错误,并且它无法解析我的.Name属性。 –