Grid view can't show result (using QueryExtender) when chosed an other Grid'view page
My page have a EntityDatasource
<asp:EntityDataSource ID="SearchEntityDataSource" runat="server"
ContextTypeName="CallSellSupport.DataAccess.supportCallEntities"
EnableFlattening="False" EntitySetName="Customers" Include="Area" OrderBy="it.CreatedDate DESC"
ConnectionString="name=supportCallEntities" DefaultContainerName="supportCallEntities">
</asp:EntityDataSource>
and QueryExtender
<asp:QueryExtender ID="SearchQueryExtender1" runat="server" TargetControlID="SearchEntityDa开发者_JS百科taSource">
<asp:SearchExpression SearchType="StartsWith" DataFields="Phone">
<asp:ControlParameter ControlID="txtPhoneNum" />
</asp:SearchExpression>
<asp:SearchExpression SearchType="Contains" DataFields="FullName">
<asp:ControlParameter ControlID="txtCustomerName" />
</asp:SearchExpression>
</asp:QueryExtender>
and a GridView (allow paging)
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataKeyNames="CustomerID" DataSourceID="SearchEntityDataSource"
AllowPaging="True" AllowSorting="True" CellSpacing="1"
PageSize="7"
I entered data into texbox, then I clicked button. Gridview display ok :)
But when I chosed Page 2 (or page 3, or page 4), then I enter data into textbox, and now, gridview doesn't display anything data, although I clicked button (many times...)
I think this problem is post back (because I change Gridview's page), but I can't find out a solution.
Hope somebody may help me...
Thanks a lot.
Please don't forget to back to the 1st page
protected void Button1_Click(object sender, EventArgs e)
{
GridView1.PageIndex = 0;
}
精彩评论