[英]Binding SolrNet query results to a GridView
Anyone know how to bind a SolrNet result set to a GridView control? 有人知道如何将SolrNet结果集绑定到GridView控件吗? I suspect it involves ObjectDataSource but I can't seem to get the right thing thrown together.
我怀疑它涉及到ObjectDataSource,但我似乎无法正确地解决问题。 Any help would be appreciated, I need this part done quickly.
任何帮助将不胜感激,我需要快速完成这一部分。
Since a SolrNet result set implements IList<T>
, you can just bind to a GridView with a few <asp:BoundField>
s (one for each property you want to bind) in the aspx, and passing the result object as DataSource before calling DataBind() 由于SolrNet结果集实现了
IList<T>
,因此您只需在aspx中使用几个<asp:BoundField>
(每个要绑定的属性一个)绑定到GridView,然后在调用之前将结果对象作为DataSource传递。 DataBind()
See also Binding Gridview to IList<BusinessObject> that contains an IList<BusinessObject> 另请参见将Gridview绑定到包含IList <BusinessObject>的IList <BusinessObject>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.