Hi, I Have a problem with grid. I'm exporting to excel data from my grid and next in excel I see strange buttons/rectangles.
I don't know how to remove these settings in export to excel.
Can u help me with this? How to remove this buttons..
I think this problem is because in headers I have filters... But when I set rgProjectList.MasterTableView.AllowFilteringByColumn = false still I have this "buttons"
Here is how I m doing export (rgProjectList is my grid.):
private void HandleExporting()
{
hlExportToExcel.NavigateUrl = this.Page.Request.Url.AbsolutePath + String.Format("?{3}={0}&{1}={2}&CurrentPage={5}&PageSize={6}{4}&Export", this.FilteringManager.ViewId.ToString(), ProjectListWeb.ActionQueryParameterName, ProjectListWeb.ExportExcelActionName, ProjectExtendedPropertiesFilteringManager.QueryStringViewParameterName, IsReportView ? "&ReportView=1" : "", GridCurrentPage, GridPageSize);
hlExportToExcel.Target = "_blank";
hlExportToCsv.NavigateUrl = this.Page.Request.Url.AbsolutePath + String.Format("?{3}={0}&{1}={2}&CurrentPage={5}&PageSize={6}{4}&Export", this.FilteringManager.ViewId.ToString(), ProjectListWeb.ActionQueryParameterName, ProjectListWeb.ExportCsvActionName, ProjectExtendedPropertiesFilteringManager.QueryStringViewParameterName, IsReportView ? "&ReportView=1" : "", GridCurrentPage, GridPageSize);
hlExportToCsv.Target = "_blank";
rgProjectList.ExportSettings.ExportOnlyData = false;
rgProjectList.ExportSettings.FileName = "ProjectsList";
rgProjectList.ExportSettings.IgnorePaging = true;
rgProjectList.ExportSettings.Csv.EncloseDataWithQuotes = true;
if (this.isExporting)
{
rgProjectList.ExportCellFormatting += rgProjectList_ExportCellFormatting;
rgProjectList.MasterTableView.AllowFilteringByColumn = false;
rgProjectList.CurrentPageIndex = rgProjectList.MasterTableView.CurrentPageIndex = GridCurrentPage;
rgProjectList.PageSize = rgProjectList.MasterTableView.PageSize = GridPageSize;
if (rgProjectList.MasterTableView.Columns.Count > 3)
{
HideColumnsBeforeExport();
GridBoundColumn boundColumn;
boundColumn = new GridBoundColumn();
boundColumn.DataField = "Status";
boundColumn.HeaderText = "Status";
boundColumn.UniqueName = "Status";
GridBoundColumn boundColumnWT;
boundColumnWT = new GridBoundColumn();
boundColumnWT.DataField = "VPProjectEndTimeIndexExport";
boundColumnWT.HeaderText = "Wskaźnik terminu";
boundColumnWT.UniqueName = "VPProjectEndTimeIndexExport";
rgProjectList.MasterTableView.Columns.Insert(0, boundColumn);
rgProjectList.MasterTableView.Columns.Add(boundColumnWT);
}
rgProjectList.MasterTableView.AllowSorting = false;
rgProjectList.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
rgProjectList.MasterTableView.AllowPaging = false;
rgProjectList.MasterTableView.AllowCustomPaging = false;
rgProjectList.MasterTableView.ExportToExcel();
}
if (this.isExportingCsv)
{
this.CsvExportManager = new FlexiCsvExportManager();
this.CsvExportManager.SetExportSettings(rgProjectList, GridCurrentPage, GridPageSize);
}
}
|
Requirements |
|
| RadControls version |
2008.03.1314.35 |
| .NET version |
2.0 |
| Visual Studio version |
2005 |
| programming language |
C# |
| browser support |
all browsers supported by RadControls |
I have a masterpage where a have defined a function below
function PopUpShowing(sender, eventArgs) {
var popUp = eventArgs.get_popUp();
var scrollTop = (typeof window.innerHeight != 'undefined' ? 0 : document.documentElement.scrollTop);
var popUpWidth = popUp.style.width.substr(0, popUp.style.width.indexOf("px"));
var popUpHeight = popUp.style.height.substr(0, popUp.style.height.indexOf("px"));
var windowHeight = (typeof window.innerHeight != 'undefined' ? window.innerHeight : document.body.offsetHeight - scrollTop);
var windowWidth = document.body.offsetWidth;
if (popUpHeight == "") popUpHeight = 300; // if the height isn't set on the popup, default to 300px
popUp.style.position = "fixed";
popUp.style.left = (Math.floor((windowWidth - popUpWidth) / 2)).toString() + "px";
popUp.style.top = (Math.floor((windowHeight - popUpHeight) / 4) + scrollTop).toString() + "px";
}
Then i have i page that opens a radwindow on button click. The radwindow contains a radgrid that has a popup editing set. So i want to call the PopUpShowing function in the masterpage to display the popup.
Hi,
we are running with 2012.1.411.35 version telerik.web.ui dll in our server with two applications. Now, we are planning to upgrade only one application to telerik version 2017.2.711.35.
Is it possible running two application with two version of telerik dlls on the same server?
Hi,
I have a pivot grid as per picture below. For Total Ratio row, need to display a value with custom calculation. Following is my calculation format.
A = SumOfQty Won
B = SumOfQty Pending
C = SumOfQty Quoted
D = SumOfQty Lost
Format Ratio (%) = [A / (A+B+C+D)] * 100
How to do it using code behind C#? I put my sample aspx code here.
<telerik:RadPivotGrid ID="RadPivotGrid1" runat="server" DataSourceID="SqlDataSource1" OnCellDataBound="RadPivotGrid1_CellDataBound" OnItemNeedCalculation="RadPivotGrid1_ItemNeedCalculation" AggregatesLevel="1" AggregatesPosition="Rows" EmptyValue="0" Skin="Bootstrap" OnPivotGridCellExporting="RadPivotGrid1_PivotGridCellExporting"> <Fields> <telerik:PivotGridRowField DataField="SummaryStatus" Caption="Status"> </telerik:PivotGridRowField> <telerik:PivotGridColumnField DataField="APP_INIT_DATE" Caption="Month"> </telerik:PivotGridColumnField> <telerik:PivotGridAggregateField DataField="Quantity" Aggregate="Sum" DataFormatString="{0}" Caption="Quantity"> <TotalFormat Level="0" Axis="Columns"></TotalFormat> </telerik:PivotGridAggregateField> <telerik:PivotGridAggregateField DataField="Price" Aggregate="Sum" DataFormatString="{0:n2}" Caption="Price (RM)"> <TotalFormat Level="1" Axis="Columns"></TotalFormat> </telerik:PivotGridAggregateField> <telerik:PivotGridAggregateField DataField="Ratio" CalculationDataFields="Quantity" CalculationExpression="{0}/100" DataFormatString="{0:n2}" CellStyle-Font-Italic="true"> </telerik:PivotGridAggregateField> </Fields> <TotalsSettings ColumnGrandTotalsPosition="First" ColumnsSubTotalsPosition="First" RowGrandTotalsPosition="First" RowsSubTotalsPosition="First" GrandTotalsVisibility="RowsAndColumns"/> </telerik:RadPivotGrid>
Thank you.
Hi Telerik,
Eight years ago, I initiated a thread "How To Prevent Double-Clicking Of Any Toolbar Button". I understand that a solution was developed by Telerik four years later here "ADD SingleClick property to the RadToolBar control."
Has there been any Telerik initiative to implement this on basically any button used anywhere? Because, realistically buttons can be clicked multiple times causing unintended consequences.
Another case in point are the "Save changes" and "Cancel changes" buttons that appear when Batch Edit is initiated in a RadGrid. I have a the following questions:
By the way, I'm using Telerik Version R3 2016.
Thank you.
Virgil
Hi,
I got a problem for using RadGrid Pagination and Export, with Hierarchy detailsTables.
Indeed When I perform an export Excel, I want to get all data in details tables.
The export is Good with all datas.
But after the dowload when i click on next , previous or collapse.
the pagination at the first level is not more activate, and all grids are expanded.
I would like at least after the download to have all grids collapse.
<div class="tableSimple"> <telerik:RadGrid AllowPaging="true" ID="RadGridCompteFournisseur" OnItemDataBound="RadGridCompteFour_ItemCreated" runat="server" AutoGenerateColumns="False" CellSpacing="0" GridLines="None" MasterTableView-GroupLoadMode="Client" OnNeedDataSource="RadGridCompteFour_NeedDataSource" OnDetailTableDataBind="RadGridCompteFour_DetailTableDataBind" HierarchyDefaultExpanded="false" ClientSettings-AllowExpandCollapse="true" SortingSettings-EnableSkinSortStyles="false" ClientSettings-EnableRowHoverStyle="true" OnItemCommand="RadGridCompteFournisseur_ItemCommand" OnItemCreated="RadGridCompteFour_ItemCreated" OnPreRender="RadGridCompteFour_PreRender" OnExcelMLExportRowCreated="RadGridCompteFour_ExcelMLExportRowCreated" OnExcelMLExportStylesCreated="RadGridCompteFour_ExcelMLExportStylesCreated"> <ExportSettings FileName="compte" Excel-Format="Html" ExportOnlyData="true" OpenInNewWindow="true"></ExportSettings> <MasterTableView DataKeyNames="Nom,ID" Name="Compte" ShowHeader="true" ShowHeadersWhenNoRecords="false" UseAllDataFields="true" AllowSorting="true" AllowMultiColumnSorting="false" AllowNaturalSort="false"> <SortExpressions> <telerik:GridSortExpression FieldName="Nom" SortOrder="Ascending" /> </SortExpressions> <Columns> <telerik:GridBoundColumn DataField="Nom" HeaderText="Nom" SortExpression="Nom" UniqueName="Nom" HeaderStyle-CssClass="colImmeNomHeader" ItemStyle-CssClass="colImmeNomItem" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" AllowSorting="False"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Solde" HeaderStyle-CssClass="colEcheanceDateHeader" ItemStyle-CssClass="colEcheanceDateItem" SortExpression="Solde" UniqueName="Solde" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"> </telerik:GridBoundColumn> </Columns> <DetailTables> <telerik:GridTableView Name="Immeubles" DataKeyNames="ImmeNo,IDDTOImmeuble" Width="100%" ShowHeader="true" ShowHeadersWhenNoRecords="false" HorizontalAlign="Right" UseAllDataFields="true"> <SortExpressions> <telerik:GridSortExpression FieldName="Ville" SortOrder="Ascending" /> </SortExpressions> <Columns> <telerik:GridBoundColumn DataField="Nom" HeaderStyle-CssClass="colImmeNomHeader" ItemStyle-CssClass="colImmeNomItem" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" AllowSorting="False"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Adresse" HeaderStyle-CssClass="colImmeAdresseHeader" ItemStyle-CssClass="colImmeAdresseItem" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" AllowSorting="False"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Ville" HeaderStyle-CssClass="colImmeVilleNomHeader" ItemStyle-CssClass="colImmeVilleNomItem" UniqueName="Ville" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Solde" HeaderStyle-CssClass="colPlanSoldeHeader" ItemStyle-CssClass="colPlanSoldeItem noWrap" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right"> </telerik:GridBoundColumn> </Columns> <DetailTables> <telerik:GridTableView Name="Details" DataKeyNames="Piece1" Width="100%" ShowHeader="true" ShowHeadersWhenNoRecords="false" HorizontalAlign="Right" UseAllDataFields="true"> <SortExpressions> <telerik:GridSortExpression FieldName="DateValeur" SortOrder="Descending" /> </SortExpressions> <Columns> <telerik:GridBoundColumn DataField="Piece1" HeaderStyle-CssClass="colPieceHeader" ItemStyle-CssClass="colPieceItem" SortExpression="Piece1" UniqueName="Piece1" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="50px"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="DateValeur" HeaderStyle-CssClass="colValeurDateHeader" ItemStyle-CssClass="colValeurDateItem" SortExpression="DateValeur" UniqueName="DateValeur" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="DateEcheance" HeaderStyle-CssClass="colEcheanceDateHeader" ItemStyle-CssClass="colEcheanceDateItem" SortExpression="DateEcheance" UniqueName="DateEcheance" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Reference" HeaderStyle-CssClass="colReferenceHeader" ItemStyle-CssClass="colReferenceItem" HeaderText="Reference" SortExpression="Reference" UniqueName="Reference" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Libelle" HeaderStyle-CssClass="colLibelleHeader" ItemStyle-CssClass="colLibelleItem" SortExpression="Libelle" UniqueName="Libelle" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" ItemStyle-Wrap="true"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Debit" HeaderStyle-CssClass="colDebitHeader" ItemStyle-CssClass="colDebitItem noWrap" HeaderText="Debit" SortExpression="Debit" UniqueName="Debit" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Credit" HeaderStyle-CssClass="colCreditHeader" ItemStyle-CssClass="colCreditItem noWrap" HeaderText="Credit" SortExpression="Credit" UniqueName="Credit" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="NonLettre" HeaderStyle-CssClass="colNonLettreHeader" ItemStyle-CssClass="colNonLettreItem noWrap" HeaderText="NonLettre" SortExpression="NonLettre" UniqueName="NonLettre" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="PDF" HeaderStyle-CssClass="colPdfHeader" ItemStyle-CssClass="colPdfItem" HeaderText="PDF" SortExpression="PDF" UniqueName="PDF" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"> </telerik:GridBoundColumn> </Columns> </telerik:GridTableView> </DetailTables> </telerik:GridTableView> </DetailTables> </MasterTableView> </telerik:RadGrid></div>
protected void btnExport_Click(object sender, EventArgs e) { RadGridCompteFournisseur.ExportSettings.IgnorePaging = true; RadGridCompteFournisseur.AllowPaging = true; foreach (GridTableView tbl in RadGridCompteFournisseur.MasterTableView.DetailTables) { tbl.HierarchyDefaultExpanded = true; //disable paging for the detail grids for the export operation tbl.AllowPaging = false; } RadGridCompteFournisseur.MasterTableView.HierarchyDefaultExpanded = true; RadGridCompteFournisseur.MasterTableView.DetailTables[0].HierarchyDefaultExpanded = true; RadGridCompteFournisseur.MasterTableView.DetailTables[0].DetailTables[0].HierarchyDefaultExpanded = true; RadGridCompteFournisseur.ExportSettings.OpenInNewWindow = true; IsModeExport = true; RadGridCompteFournisseur.MasterTableView.DetailTables[0].DetailTables[0].GetColumn("PDF").Visible = false; RadGridCompteFournisseur.MasterTableView.ExportToExcel(); Statistique stat = Contexte.GestStat; if (stat != null) stat.Tick("ExportComptes"); }