【发布时间】:2009-04-01 08:33:05
【问题描述】:
这是我的 Page_Load 事件代码
OdbcConnection myConnection;
DataSet dataSet = new DataSet();
OdbcDataAdapter adapter;
//making my connection
myConnection = new OdbcConnection(ConfigurationManager.ConnectionStrings ["ODBC_ConnectionString"].ConnectionString);
adapter = new OdbcDataAdapter("SELECT * from Company", myConnection);
adapter.Fill(dataSet, "MyData");
GridView1.DataSource = dataSet;
Session["DataSource"] = dataSet;
GridView1.DataBind();
这是我的 PageIndexChanging 事件代码,一切正常。
DataSet ds = new DataSet();
if (Session["DataSource"] != null)
ds = ((DataSet)Session["DataSource"]);
GridView1.DataSource = ds;
GridView1.PageIndex = e.NewPageIndex;
this.GridView1.DataBind();
现在我需要什么代码来创建排序事件?
protected void GridView1_Sorting(object sender, GridViewSortEventArgs e)
{
?????????????????????????
}
艾蒂安
【问题讨论】:
标签: c# asp.net gridview sorting