Gridview Pagination PostBack Issue
Hi,
I have a Gridview with 4 columns, NAME , DATE OF BIRTH, HOBBIES & TEAM.
When the Page loads all the Employees of All teams are displayed in GridView.
I have put a DROPDOWN BOX on Top of this Gridview, through which User can Select a TEAM & a BUTTON beside it. When User Selects one TEAM from DropDown & Click's the BUTTON, I have written the following code:-
protected void Button1_Click(object sender, EventArgs e)
{
string TeamSelected;
TeamSelected = SearchDropDown.SelectedItem.ToString();
Menu.SelectCommand = "SELECT [Emp_id], [Emp_fullname], [Emp_prefname], [Emp_hobbies], [Emp_birthday], [Emp_team] FROM [Employee] WHERE [Emp_team]='" + TeamSelected + "'";
}
Its all working fine. But the problem arises when User clicks on PAGINATION, if the User clicks on PAGE no. 2, then again All the TEAMS are shown in GridView.
I disabled the VIEWSTATE, , it didn't worked for me.
Any Solution Pls.
Thannk u....!!
|