Hello Team,
I have created a radgrid from Cs as per the wbelow code:
On Grid Created Event We have called a page that gives data in Json Object as below:
Once it bind the data to grid, It seems all data in one page rather then displaying only data of first page defined in page size.
Can anyone help me out with this?
Thanks and regards,
Ruchi Patel
I have created a radgrid from Cs as per the wbelow code:
RadGrid radGridNew = new RadGrid();
radGridNew.ID = "rgAcc" + Guid.NewGuid().ToString().Replace("-", "");
radGridNew.ClientSettings.ClientEvents.OnGridCreated = "GridCreated";
radGridNew.ClientSettings.ClientEvents.OnCommand = "RadGrid1_Command";
radGridNew.AllowPaging = true;
radGridNew.PageSize = 10;
GridBoundColumn colLogDate = new GridBoundColumn();
colLogDate.DataField = "LogDate";
colLogDate.UniqueName = "LogDate";
colLogDate.DataType = typeof(DateTime);
colLogDate.HeaderText = "Log date";
GridBoundColumn colIPAddress = new GridBoundColumn();
colIPAddress.DataField = "IPAddress";
colIPAddress.UniqueName = "IPAddress";
colIPAddress.DataType = typeof(string);
colIPAddress.HeaderText = "IP Address ";
GridBoundColumn colResult = new GridBoundColumn();
colResult.DataField = "Result";
colResult.UniqueName = "Result";
colResult.DataType = typeof(string);
colResult.HeaderText = "Result";
radGridNew.Columns.Add(colLogDate);
radGridNew.Columns.Add(colIPAddress);
radGridNew.Columns.Add(colResult);
radGridNew.AllowSorting = true;
radGridNew.MasterTableView.AllowMultiColumnSorting = true;
radGridNew.ShowFooter = true;
radGridNew.AutoGenerateColumns = false;
radGridNew.MasterTableView.PagerStyle.AlwaysVisible = true;
radAcc.Controls.Add(radGridNew);
On Grid Created Event We have called a page that gives data in Json Object as below:
function GridCreated(sender, eventArgs) {
var Id = sender.ClientID;
$.ajax({
type: "GET",
url: "LoadWidgetsAsync.aspx",
contentType: "application/json; charset=utf-8",
data: { Wid: 1, widgetName: "AccountActivityWidget", ID: Id },
async: true,
success:
function (result) {
if (result.length > 0) {
var grid = $find(result[0]);
var tableView = grid.get_masterTableView();
tableView.set_dataSource(result[1]);
tableView.dataBind();
}
},
error: function () {
alert('Error on binding the data');
}
});
}
Once it bind the data to grid, It seems all data in one page rather then displaying only data of first page defined in page size.
Can anyone help me out with this?
Thanks and regards,
Ruchi Patel