Gridview绑定ObjectDataSource后,通过查询如何更新ObjectDataSource
Gridview已经绑定了一个数据源,在显示列表的页面,通过点击搜索搜索出符合条件的记录显示在Gridview上,请问如何通过修改ObjectDataSource实现这种功能?有分页功能
Gridview已经绑定了一个数据源,在显示列表的页面,通过点击搜索搜索出符合条件的记录显示在Gridview上,请问如何通过修改ObjectDataSource实现这种功能?有分页功能
推荐老外写的,google一下,有代码!!
Scott Mitchell 的ASP_NET 2_0数据教程
那就把绑定gridview 写到一个方法里
重新绑定 ,再调用这个方法
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="InfoCatalogList"
TypeName="Bitsoft.Contents.InfoCatalog" SelectCountMethod="GetTotalOfInfoCatalog"
MaximumRowsParameterName="startRowIndexId" StartRowIndexParameterName="maxNumberRows">
<SelectParameters>
<asp:Parameter Name="startRowIndexId" Type="Int32" />
<asp:Parameter Name="maxNumberRows" Type="Int32" />
<asp:ControlParameter ControlID="TxtKeyWord" Type="String" Name="strKeyWord" PropertyName="Text" />
<asp:ControlParameter ControlID="DropQueryType" Type="String" Name="strQuerytype" PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="HdnDeptId" Type="String" Name="strDeptId" PropertyName="Value" />
</SelectParameters>
</asp:ObjectDataSource>