How to refresh Radgrid [Resolved]

Posted by Vatcharm under ASP.NET AJAX on 2/24/2010 | Views : 25900 | Status : [Member] | Replies : 2
Hi Guru
I put Radgird and button into page when user clikc button radgrid display data that select from sql (not use SqlDataSource control) .
I have problem when user click page number 2 radgrid disble but repeated click button radgrid show data page2

help me please
thank you
protected void btnSearch_Click(object sender, EventArgs e)
string conStr = ConfigurationManager.ConnectionStrings["DCDBStr"].ToString();
SqlConnection myCon = new SqlConnection(conStr);
string sqlStr = string.Format("SELECT o.SOID,o.PONO,o.ShipTo,s.ShipToName,o.MaterialCode,m.MaterialName,o.Quantity,m.Units FROM ServiceOrders o LEFT JOIN Materials m ON m.MaterialCode = o.MaterialCode LEFT JOIN ShipToParty s ON s.ShipTo=o.ShipTo WHERE PONO='{0}'", txtPONO.Text);
SqlDataAdapter da = new SqlDataAdapter(sqlStr, myCon);
DataSet ds = new DataSet();
da.Fill(ds, "x");
DataTable dt = ds.Tables["x"];
if (dt.Rows.Count > 0)
RadGrid1.DataSource = dt;
RadAjaxManager1.Alert("No Invoice");



Posted by: Vuyiswamb on: 2/24/2010 [Member] [MVP] [Administrator] NotApplicable


So you want Paging in Radgrid ?

If so look at this Article

and in your Radgrid use

protected void RadGrid1_PageIndexChanged(object source, GridPageChangedEventArgs e) 

int Index = RadGrid1.CurrentPageIndex;
//rebind the Grid as shown in the above article

Thank you for Posting at Dotnetfunda

Vuyiswa Maseko

Thank you for posting at Dotnetfunda

Vatcharm, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Nishithraj on: 2/24/2010 [Member] Bronze

Compare your aspx with the following

Mark this as answer, if it is.....

With regards
Nishithraj Narayanan

Vatcharm, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response