This is a migrated thread and some comments may be shown as answers.

Number data formating when Export RadGrid excel biff format with template Column

6 Answers 259 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Allin
Top achievements
Rank 1
Allin asked on 11 Oct 2013, 02:10 PM
Hi,

I tried to export RadGrid to Excel into Biff format. I have a Template Column format like this :

<telerik:GridTemplateColumn UniqueName="Projection3" DataField="Projection3" HeaderText="Projection 3" HeaderStyle-Width="130px" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"
    Aggregate="Sum" DataType="System.Decimal" FooterStyle-HorizontalAlign="Right" FooterText=" " FooterAggregateFormatString="{0:### ### ### ##0}">
    <ItemTemplate>
        <%# String.Format("{0:### ### ### ##0;(### ### ### ##0);0}", Eval("Projection3"))%>
    </ItemTemplate>
    <EditItemTemplate>
        <telerik:RadNumericTextBox ID="rntbProjection3" runat="server" Width="100%" Text='<%# Bind("Projection3")%>' MaxValue="999999999" MinValue="-999999999" CssClass="NumberAlignRight">
            <NumberFormat DecimalDigits="0" />
            <IncrementSettings InterceptArrowKeys="false" />
        </telerik:RadNumericTextBox>
    </EditItemTemplate>
</telerik:GridTemplateColumn>

The SuppressColumnDataFormatStrings=True don't work with template column.

Settings of export grid are :
.ExportSettings.IgnorePaging = True
.ExportSettings.ExportOnlyData = True
.ExportSettings.OpenInNewWindow = True
.ExportSettings.SuppressColumnDataFormatStrings = True
.ExportSettings.HideStructureColumns = False


How can change the export format of this column to {0:0} when i export my RadGrid.

ty




6 Answers, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 16 Oct 2013, 01:18 PM
Hello,

I am afraid that you could not suppress the format of a TempalteColumn. You have to use a Bound columns in order to use this property.

Regards,
Kostadin
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Allin
Top achievements
Rank 1
answered on 16 Oct 2013, 03:08 PM
Hi Kostadin,

Two issues with GridNumericColumn or GridMaskedColumn :

1. How to align text to right in EditMode? I tried a lot of settings without success and item-style-align=Right work only when display.
2. In EditMode the control don't fit into column, i lost de right side of the box and if i have 2 numericColumn in a row, the 2 box have no space beetween column

See attachments.

ty
0
Allin
Top achievements
Rank 1
answered on 17 Oct 2013, 06:49 PM
Another issue with GridBoundColumn

With this configuration :

<telerik:GridBoundColumn UniqueName="Description" DataField="Description" MaxLength="150" HeaderText="Description" HeaderStyle-Width="100%" ItemStyle-Width="100%"></telerik:GridBoundColumn>
The lenght of the Edit field for the column Description will never be more than 150px when i 
try to edit InPlace into grid.

Here's another reason why we must often use GridTemplateColumn.
0
Kostadin
Telerik team
answered on 21 Oct 2013, 10:39 AM
Hi,

I understand your concern but SuppressColumnDataFormatStrings could not be applied to a TemplateColumn due to the variety of content which could be nested. I noticed that you are setting a width in percentage. If you use the dimension in pixels then you could set a width more than 150 px.

Regards,
Kostadin
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Hans
Top achievements
Rank 1
answered on 21 Oct 2013, 12:20 PM
Like the example paste into the last post?
0
Kostadin
Telerik team
answered on 24 Oct 2013, 10:50 AM
Hi Hans,

Could you please elaborate a little bit more on your requirement? The code which is provided by the other user has a relative width and height and in order to set a larger dimensions he should use absolute values.

Regards,
Kostadin
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
Allin
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Allin
Top achievements
Rank 1
Hans
Top achievements
Rank 1
Share this question
or