简体   繁体   English

如何绑定IList类型的属性abc <string> 到文本框作为数据字段

[英]how to bind property abc of type IList<string> to textbox as a datafield

I am working on a report and I have a property of type IList as follows: 我正在处理报告,并且具有IList类型的属性,如下所示:

public IList<string> abc { get; set; }

I have populated this list in code, but how can I assign this populated list to textbox's datafield property in order to get list data on report. 我已经在代码中填充了此列表,但是如何将该填充的列表分配给文本框的datafield属性,以获取报表中的列表数据。

StringBuilder sb = new StringBuiler();  
Foreach (string s in abc)  
   sb.AppendLine(s);
Mytextbox.Text = sb.ToString();

Make the TextBox multiline 使TextBox多行
If you don't want lines then sb.Append() 如果你不想要行,那么sb.Append()

Have you looked at the IListBinding sample that comes with the installer? 您是否看过安装程序随附的IListBinding示例? It essentially does what you are trying to accomplish. 本质上,它可以完成您要完成的任务。

you can find it here on your machine. 您可以在计算机上的此处找到它。 (ActiveReports 9) (ActiveReports 9)

C:\\Users\\\\Documents\\ComponentOne Samples\\ActiveReports 9\\Section Reports\\Data\\IListBinding C:\\ Users \\\\ Documents \\ ComponentOne Samples \\ ActiveReports 9 \\ Section Reports \\ Data \\ IListBinding

If you are sill having issues, email activereports.support@grapecity.com with ref to this post. 如果您仍然遇到问题,请发送电子邮件至activereports.support@grapecity.com,并提供有关此帖子的参考。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将字符串属性绑定到ListBox中的TextBox - How to bind string property to TextBox within ListBox 如何将ObservableCollection绑定到XAML中的IList属性? - How to bind ObservableCollection to IList property in XAML? 如何将文本框的borderBrush属性绑定到ViewModel中的属性,类型转换错误 - How to bind the borderBrush property of a textbox to a property in viewmodel, type conversion error 将非属性绑定到datagrid列DataField? - Bind non-property to datagrid column DataField? 如何更正绑定属性到文本框? - How to correct bind property to textbox? 如何将class属性绑定到TextBox? - How to bind a classes property to a TextBox? 如何根据提供要绑定到的属性名称的字符串属性绑定TextBox.Text? - How to bind TextBox.Text according to a string property that provides the name of the property I want to bind to? 具有字符串数据类型属性的WPF文本框绑定应仅接受数字值 - WPF Textbox bind with string data type property should accept only numeric value 在BindingSource IList属性中将文本框绑定到特定的DataRowView - Binding a TextBox to a particular DataRowView in a BindingSource IList property NHibernate如何查询IList <string>属性? - NHibernate How do I query against an IList<string> property?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM