heyy..
I use ajax jquery gridview to load a large amount of data..but the grid does not load..if less amount of data came the grid will display....otherwise it is not displayed...
So how to handle the large amount of data to display in ajax gridview...here is my code...
function ShowBillDetails(control)
{
$('#divGrid').html('');
$('#divGrid').hide();
$('#DisableDiv').show();
var phoneNumber = $(control).attr('PhoneNumber').toString();
showBillDialog();
setTimeout(function() { ShowBills(phoneNumber) },3000);
return false;
}
// for show the data in grid
function ShowBills(phoneNumber) {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "LinkingCustomers.aspx/GetBillData",
data: "{'phoneNumber':'" + phoneNumber + "'}",
dataType: "json",
success: function(data) {
var theHtml = data.d;
$('#divGrid').show();
$('#divGrid').html(theHtml)
$('#DisableDiv').hide();
}
,
error: function(result) {
alert(result);
}
});
}
code.cs
---------
#region WebMethods
[WebMethod]
public static string GetBillData(string phoneNumber)
{
GridView gv = new GridView();
System.IO.StringWriter stringWriter = new System.IO.StringWriter();
HtmlTextWriter htmlWriter = new HtmlTextWriter(stringWriter);
DataTable objDT = new DataTable();
objDT = LinkingCustManager.GetBillData(phoneNumber);
gv.CssClass = "gridtable";
gv.DataSource = objDT;
gv.DataBind();
gv.RenderControl(htmlWriter);
return stringWriter.ToString();
}
#endregion