Bladesfist
New Member
I have a Gridview whose datasource is an EntityDataSource. AllowPaging is set to true (see code). On the page there is a DropDownList as well. When the page loads initially the grid is populated with all the data in the associated data source [unfiltered]. When / if the user selects an item from the DropDownList, the data in the Gridview get's filtered accordingly. The problem, is,...when I select a page from the newly filtered list, the filter gets taken away some how, so insead of getting the next page of the filtered list, i get the next page of all the data. How do i correct this?\[code\]------the opening grid declaration-----<asp:GridView ID="gvAthleteInfo" runat="server" DataKeyNames="AthleteUid" DataSourceID="dsAthleteInfo" HeaderStyle-CssClass="dl-grid-heading" AutoGenerateColumns="false" OnRowCommand="gvAthleteInfo_RowCommand" AllowPaging="true" AllowSorting="true">\[/code\]... ---------the data source tied to the grid---------- -----------the "filtering" of the grid data on a change of the DropDownList selection-----------------\[code\]protected void ddlTeams_IndexChanged(object sender, EventArgs e){ if (ddlTeams.SelectedIndex > 0) dsAthleteInfo.Where = "it.SportUid = " + ddlTeams.SelectedIndex.ToString(); else dsAthleteInfo.Where = "it.SportUid >= 0"; dsAthleteInfo.DataBind();}\[/code\]