General information
Category:
Mobile development
Ok,
I got this one to work. This is how I did it in C#.
private void dgBatchOverview_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
{
dgBatchOverview.CurrentPageIndex = e.NewPageIndex;
BindGrid((e.NewPageIndex * dgBatchOverview.PageSize) + 1, (e.NewPageIndex * dgBatchOverview.PageSize) + dgBatchOverview.PageSize);
}
public void BindGrid(int st, int nd)
{
string param;
param = "@BD";
SqlConnection CurrentConn = MobileConn.ReturnValidConnection();
SqlCommand cmdBatchSummary = new SqlCommand("Q1",CurrentConn);
DataSet dsBatchSummary = new DataSet();
cmdBatchSummary.Connection = CurrentConn;
cmdBatchSummary.CommandType =System.Data.CommandType.StoredProcedure;
cmdBatchSummary.CommandText = "Q1";
cmdBatchSummary.Parameters.Add(param,System.Data.SqlDbType.VarChar,50);
cmdBatchSummary.Parameters[param].Value = lblSelectedBatchDate.Text;
SqlDataAdapter daBatchSummary = new SqlDataAdapter();
daBatchSummary.SelectCommand = cmdBatchSummary;
daBatchSummary.Fill(dsBatchSummary);
dgBatchOverview.DataSource = dsBatchSummary.Tables[0].DefaultView;
dgBatchOverview.VirtualItemCount = 9;
dgBatchOverview.DataBind();
}
HTH
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only