Hi
I tried to implement the Dynamic Rad Grid Creation through code behind(Telerik version Q3 2009 Sp2). The Control is working fine and datas are showing in the grid in More then 200 records. So i set the page size is 25 in rad grid. When Click the Second Link the Data are are Disappear. The grid was gone . Let me know how can i fix the Rad grid dynamic pagenation issue. herewith i have send the sample code and sample print screen.
//Global Declaration
OrderManager orderManager = new OrderManager();
protected void Page_Load(object sender, EventArgs e)
{
RadGrid Grid = (RadGrid)pnlReservationGrid.FindControl("OrderGrid");
if (Grid != null)
{
AjaxDynamicReport.AjaxSettings.AddAjaxSetting(Grid, Grid);
}
}
//Page Load
protected void Page_Init(object sender, System.EventArgs e)
{
OrderGrid.ID = "OrderGrid";
OrderCheckinDateReport();
OrderGrid.AllowPaging = true;
}
public void OrderCheckinDateReport()
{
List<OrderData> aOrderDataList = new List<OrderData>();
fromDate = (Convert.ToDateTime(locateReservationStartDatePicker.SelectedDate));
if (locateReservationStartDatePicker.SelectedDate != null && locateReservationLastDatePicker.SelectedDate != null)
{
toDate = (Convert.ToDateTime(locateReservationLastDatePicker.SelectedDate));
}
if (locateReservationStartDatePicker.SelectedDate != null && locateReservationLastDatePicker.SelectedDate == null)
{
toDate = toDate = fromDate.AddDays(30);
}
aOrderDataList = orderManager.GetRentalAgreementNotAgreedByCheckInDate(fromDate, toDate);
OrderGrid.AllowPaging = true;
OrderGrid.PageSize = 25;
OrderGrid.DataSource = aOrderDataList;
OrderGrid.AlternatingItemStyle.BackColor = Color.LightGray;
OrderGrid.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric;
OrderGrid.Width = Unit.Percentage(98);
OrderGrid.AllowSorting = false;
OrderGrid.AutoGenerateColumns = false;
GridBoundColumn boundColumn;
List<OrderReportData> aOrderReportDataList = new List<OrderReportData>();
aOrderReportDataList = orderManager.OrderReportColumn();
foreach (OrderReportData aOrderReportData in aOrderReportDataList)
{
boundColumn = new GridBoundColumn();
boundColumn.DataField = aOrderReportData.DTOName;
boundColumn.HeaderText = aOrderReportData.DisplayName;
boundColumn.HeaderStyle.Width = aOrderReportData.CellHeight;
OrderGrid.MasterTableView.Columns.Add(boundColumn);
}
OrderGrid.DataBind();
pnlReservationGrid.Controls.Add(OrderGrid);
}
Aspx page
<div class="updaterategroupshistorypnl" style="clear:both;" >
<asp:Panel ID="pnlReservationGrid" runat="server" GroupingText="<%$ Resources:AdminResource,pnlRateHistory%>">
</asp:Panel>
</div>
<JetSoft:RadAjaxManager ID="AjaxDynamicReport" runat="server">
</JetSoft:RadAjaxManager>
public void Display_Click(object sender, EventArgs e)
{
OrderCheckinDateReport();
}
Thanks
G. Manikandan