用这个控件导出时,百分比导出来的是小数,请问该怎样转换?
protected void btn_Output0_Click(object sender, EventArgs e)
{
UltraWebGridExcelExporter1.DownloadName = ddlSTYLEBRAND.SelectedValue;
UltraWebGridExcelExporter1.Export(UltraWebGrid1);
} protected void UltraWebGrid1_InitializeLayout(object sender, Infragistics.WebUI.UltraWebGrid.LayoutEventArgs e)
{
// Allow for deletion
e.Layout.AllowDeleteDefault = Infragistics.WebUI.UltraWebGrid.AllowDelete.Yes;
// allow update for the WebGrid
e.Layout.AllowUpdateDefault = Infragistics.WebUI.UltraWebGrid.AllowUpdate.Yes; Infragistics.WebUI.UltraWebGrid.UltraGridColumn c; // Sets up the format for the Received column
c = e.Layout.Bands[0].Columns.FromKey("调出比");
c.Format = "###,###0.00%";
c.CellStyle.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(224)), ((System.Byte)(224)), ((System.Byte)(224)));
c.CellStyle.HorizontalAlign = HorizontalAlign.Right;
c.DefaultValue = 0; c = e.Layout.Bands[0].Columns.FromKey("调入比");
c.Format = "###,###0.00%";
c.CellStyle.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(224)), ((System.Byte)(224)), ((System.Byte)(224)));
c.CellStyle.HorizontalAlign = HorizontalAlign.Right;
c.DefaultValue = 0; c = e.Layout.Bands[0].Columns.FromKey("销量比");
c.Format = "###,###0.00%";
c.CellStyle.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(224)), ((System.Byte)(224)), ((System.Byte)(224)));
c.CellStyle.HorizontalAlign = HorizontalAlign.Right;
c.DefaultValue = 0; // turn off editing of the last column
c.AllowUpdate = Infragistics.WebUI.UltraWebGrid.AllowUpdate.No;
}
protected void btn_Output0_Click(object sender, EventArgs e)
{
UltraWebGridExcelExporter1.DownloadName = ddlSTYLEBRAND.SelectedValue;
UltraWebGridExcelExporter1.Export(UltraWebGrid1);
} protected void UltraWebGrid1_InitializeLayout(object sender, Infragistics.WebUI.UltraWebGrid.LayoutEventArgs e)
{
// Allow for deletion
e.Layout.AllowDeleteDefault = Infragistics.WebUI.UltraWebGrid.AllowDelete.Yes;
// allow update for the WebGrid
e.Layout.AllowUpdateDefault = Infragistics.WebUI.UltraWebGrid.AllowUpdate.Yes; Infragistics.WebUI.UltraWebGrid.UltraGridColumn c; // Sets up the format for the Received column
c = e.Layout.Bands[0].Columns.FromKey("调出比");
c.Format = "###,###0.00%";
c.CellStyle.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(224)), ((System.Byte)(224)), ((System.Byte)(224)));
c.CellStyle.HorizontalAlign = HorizontalAlign.Right;
c.DefaultValue = 0; c = e.Layout.Bands[0].Columns.FromKey("调入比");
c.Format = "###,###0.00%";
c.CellStyle.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(224)), ((System.Byte)(224)), ((System.Byte)(224)));
c.CellStyle.HorizontalAlign = HorizontalAlign.Right;
c.DefaultValue = 0; c = e.Layout.Bands[0].Columns.FromKey("销量比");
c.Format = "###,###0.00%";
c.CellStyle.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(224)), ((System.Byte)(224)), ((System.Byte)(224)));
c.CellStyle.HorizontalAlign = HorizontalAlign.Right;
c.DefaultValue = 0; // turn off editing of the last column
c.AllowUpdate = Infragistics.WebUI.UltraWebGrid.AllowUpdate.No;
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货