开发者

Binding SolrNet query results to a GridView

开发者 https://www.devze.com 2023-01-10 05:06 出处:网络
Anyone know how to bind a SolrNet result set to a GridView control? I suspect it involves ObjectDataSource but I can\'t seem to get the right thing thrown together. Any help would be appreciated, I ne

Anyone know how to bind a SolrNet result set to a GridView control? I suspect it involves ObjectDataSource but I can't seem to get the right thing thrown together. 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()

See also Binding Gridview to IList<BusinessObject> that contains an IList<BusinessObject>

0

精彩评论

暂无评论...
验证码 换一张
取 消