ASP.Net Gridview behavior after update

I have an ASP.Net page (C# code behind, Access database) that displays 4 girdviews. I have two columns, side by side. The left column has starters on top, bench on bottom for batter (it's a baseball site). The right column has starters on top and bench on bottom for pitchers. The pitchers each have a button in their row, "Bench" in the starters gird, "Start" on the bench grid. Cliking this button changes a value in the underlying table in the starter field to 1 for starter, 0 for bench, When clicked the player is moved to the opposite grid, immediately. The grid displays the update very qucikly without a complete page refresh. These work fine. The batters grids do work properly. The batter bench grid also has a dropdownlist, an update button and a start button. The drop downlist displays all of the positions a player is quaified for. The user picks one, then clicks the update button to update the positinon. This seems to work, but its gets flaky at times so I'm not sure if its completely correct. If you click the Start button in the batter bench grid, he is moved to the Starter gird immeediately. But, if youbench someone from the starter gird, he is removed from starters but is not displayed in the bench. You have to completely refresh the page. I want the batter grids to behave as the pitcher grids do, displaying the changes immeditately without having to refresh the page. If possible, I would also prefer to have the batter bench grid dropdownlist update the table without having to click the update button. Is that possible? I've attached the code for the page, and any help is appreciated. Default2.aspx Default2.aspx.cs
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

If you code the DropDown IndexChanged event you can code whatever you like into that method.  Ensure that the method will be called by setting the DropDownList as AutoPostback.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dodgerfanAuthor Commented:
I have been trying to get the code to work within thr SelectedIndexChanged event, but I do not know how to grab the playerid of the individual records within the gridview. How can I do that?

 protected void ddlPos_SelectedIndexChanged(object sender, EventArgs e)
            AccessDataSource ac = new AccessDataSource();
            GridView BenchGrid = (GridView)this.FindControl("BatterBenchGrid");
            String playerID = BenchGrid.DataKeys[int.Parse(e.ToString())].Value.ToString();

            DropDownList ddlPos = (DropDownList)BenchGrid.Rows[int.Parse(e.ToString())].FindControl("ddlPos");
            ac.DataFile = "~/App_Data/BaseballXP_Working.mdb";
            ac.UpdateCommand = "UPDATE vwBatterWorksheet SET PosNo = " + ddlPos.SelectedValue + " WHERE ID = " + playerID;
            ac.UpdateCommandType = SqlDataSourceCommandType.Text;
dodgerfanAuthor Commented:
close enough.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.