Paging problem for run time query

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
jiayu821
Posts: 8
Joined: Thu 21 May 2009 05:22

Paging problem for run time query

Post by jiayu821 » Thu 18 Jun 2009 02:58

I have a ASPxGridView and a Devart.OracleDataSource in my page,if i put the query in OracleDataSource in design time,

when i browse the page ,i can data and i can paging it, but if i put the query in OracleDataSource in run time,like this

protected void ASPxButton1_Click(object sender, EventArgs e)
{
string sqlText = "SELECT ...";
OracleDataSource1.SelectCommand = sqlText;
OracleDataSource1.DataBind();
}

i can get the first page of data,when i paging ,i can't get any data, and now if i click then button,i can also get the data,

but the page is not the first page ,it's the page i have paging before, what can i do to correct it ,and get the right data?

Shalex
Devart Team
Posts: 8088
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Thu 18 Jun 2009 13:48

Microsoft's SqlDataSource has the same behaviour. But you can set the current page index manually:

Code: Select all

protected void ASPxButton1_Click(object sender, EventArgs e)
{
string sqlText = "SELECT ...";
OracleDataSource1.SelectCommand = sqlText;
OracleDataSource1.DataBind();
ASPxGridView1.PageIndex = 0;
} 

Post Reply