protected void searchjob(object sender, EventArgs e) { jobWeaponArmors = repository.GetJobWeaponArmos(); List <JobWeaponArmo> jobWeaponArmorsFilter = new List <JobWeaponArmo>(); if (textboxfilter.Text == "All" || textboxfilter.Text == "all") { GridViewJWA.DataSource = repository.GetJobWeaponArmos(); GridViewJWA.DataBind(); } else { for (int i = 0; i < jobWeaponArmors.Count(); i++) { if (textboxfilter.Text == jobWeaponArmors[i].job) { jobWeaponArmorsFilter.Add(jobWeaponArmors[i]); } } GridViewJWA.DataSource = jobWeaponArmorsFilter; GridViewJWA.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { GridViewJWA.DataSource = repository.GetJobWeaponArmos(); GridViewJWA.DataBind(); }