Hi Follows, First Sorry about my english.
I am with the following problem.
I Have a "Radgridview" configured with options for export to excel, pagination, pagesized and sorting and it are inside a "RadAjaxPanel" basically.
follows the structure:
<telerik:RadAjaxPanel ...
<telerik:RadGrid OnItemCommand="GridView_RowCommand" OnPageIndexChanged="GridView_Pagination"
OnPageSizeChanged="GridView_PageSize"...
the function "export to excel" needs of real postback to do the exportation, for this I've been used the "RegisterPostBackControl" forcing the button of the exportation to do the postback.
Follows the code:
ScriptManager.GetCurrent(Page).RegisterPostBackControl(exportButton);
I Don't use DataSource plugged on RadGrid, in all interaction like pagination or change page size or sorting, I use method on the code-behind to do the search again and I force the RegisterPostBackControl again.
Basically the methods apply the instructions and do the new search. OBS: Pagination, pagesized, Sorting are Ok.
The Problem:
When I changed the page or sorting or pagesized, and after any this actions I try to export to excel, the all grid rebind but without pagination control, pagesized control and the sorting and the export dont work.
protected virtual void GridView_RowCommand(object sender, GridCommandEventArgs e)
{
switch (e.CommandName)
{
case SharedHardCode.CommandName.View:
this.ViewObject(sender, e);
break;
case SharedHardCode.CommandName.Active:
this.ActiveObject(sender, e);
break;
case RadGrid.ExportToExcelCommandName:
this.ExportToExcel(((RadGrid)sender));
break;
case SharedHardCode.CommandName.ExportToPdf:
this.ExportToPdf(((RadGrid)sender));
break;
}
}
protected void GridView_Pagination(object sender, GridPageChangedEventArgs e)
{
this.PaginationHelper((RadGrid)sender);
}
protected void GridView_Bind(object dataSource, RadGrid grid)
{
grid.DataSource = dataSource;
grid.DataBind();
grid.Rebind();
//Registra controles de exportação como postback
this.RegisterPostBackControl(ExportToExcelButton);
}
I am with the following problem.
I Have a "Radgridview" configured with options for export to excel, pagination, pagesized and sorting and it are inside a "RadAjaxPanel" basically.
follows the structure:
<telerik:RadAjaxPanel ...
<telerik:RadGrid OnItemCommand="GridView_RowCommand" OnPageIndexChanged="GridView_Pagination"
OnPageSizeChanged="GridView_PageSize"...
the function "export to excel" needs of real postback to do the exportation, for this I've been used the "RegisterPostBackControl" forcing the button of the exportation to do the postback.
Follows the code:
ScriptManager.GetCurrent(Page).RegisterPostBackControl(exportButton);
I Don't use DataSource plugged on RadGrid, in all interaction like pagination or change page size or sorting, I use method on the code-behind to do the search again and I force the RegisterPostBackControl again.
Basically the methods apply the instructions and do the new search. OBS: Pagination, pagesized, Sorting are Ok.
The Problem:
When I changed the page or sorting or pagesized, and after any this actions I try to export to excel, the all grid rebind but without pagination control, pagesized control and the sorting and the export dont work.
protected virtual void GridView_RowCommand(object sender, GridCommandEventArgs e)
{
switch (e.CommandName)
{
case SharedHardCode.CommandName.View:
this.ViewObject(sender, e);
break;
case SharedHardCode.CommandName.Active:
this.ActiveObject(sender, e);
break;
case RadGrid.ExportToExcelCommandName:
this.ExportToExcel(((RadGrid)sender));
break;
case SharedHardCode.CommandName.ExportToPdf:
this.ExportToPdf(((RadGrid)sender));
break;
}
}
protected void GridView_Pagination(object sender, GridPageChangedEventArgs e)
{
this.PaginationHelper((RadGrid)sender);
}
protected void GridView_Bind(object dataSource, RadGrid grid)
{
grid.DataSource = dataSource;
grid.DataBind();
grid.Rebind();
//Registra controles de exportação como postback
this.RegisterPostBackControl(ExportToExcelButton);
}