Programming Journal C#, Java, SQL and to a lesser extent HTML, CSS, XML, and regex. I made this so other programmers could benefit from my experience.

Saturday, October 6, 2007

Swapping GridView DataSourceID from DataSource

Here's the simple code for swapping the GridView back to DataSourceID from DataSource:


protected void DropDownListListsInUser_SelectedIndexChanged(object sender, EventArgs e)
{
GridViewStocksInList.DataSource = null;
GridViewStocksInList.DataSourceID = SqlDataSourceGetStocksInList.ID;
GridViewStocksInList.DataBind();
}

The solution came from here.
It suggested studying this.

No comments: