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

RadGrid Export To Excel

1 Answer 73 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rasool
Top achievements
Rank 1
Rasool asked on 10 May 2015, 07:41 AM

Hi

Dear

 I have a grid with template column (item template and edit template) and i use required validation (client side) in item template because it is radtextbox, when export to excel, these fields have '*' in excel file .Why?

 <telerik:GridTemplateColumn FilterControlWidth="70%" AutoPostBackOnFilter="true" DataField="Shomaresh"
                        HeaderStyle-Width="100px" HeaderText="<%$ Resources:Resource, Shomaresh %>"
                        UniqueName="Shomaresh">
                        <ItemTemplate>
                            <telerik:RadNumericTextBox Width="100%"  runat="server" ID="rtxt_Shomaresh" Text='<%# Bind("Shomaresh") %>'>
                            </telerik:RadNumericTextBox>
                            <asp:RequiredFieldValidator ID="RFV_Shomaresh" runat="server" ErrorMessage="<%$ Resources:Resource, Shomaresh %>" Text="*" ValidationGroup="AnbarGardani" ControlToValidate="rtxt_Shomaresh" ForeColor="Red"></asp:RequiredFieldValidator>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <telerik:RadNumericTextBox Width="100%" runat="server" ID="rtxt_Shomaresh" Text='<%# Bind("Shomaresh") %>'>
                            </telerik:RadNumericTextBox>
                            <asp:RequiredFieldValidator ID="RFV_Shomaresh" runat="server" ErrorMessage="<%$ Resources:Resource, Shomaresh %>" Text="*" ValidationGroup="AnbarGardani" ControlToValidate="rtxt_Shomaresh" ForeColor="Red"></asp:RequiredFieldValidator>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>

I think this problem comes from required validator in item template.Other template columns that are not validator ,dont have this problem.

Please help.

 Thanks.

 

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 13 May 2015, 07:12 AM
Hello Rasool,

Note that you do not actually need RequiredFieldValidator in the ItemTemplate as it content only renders when the RadGrid is not in edit mode and the input there is not editable. You need the validator control only in the EditItemTemplate.
Pease try to remove the RequiredFieldValidator form the ItemTemplate and see how it goes.

Regards,
Maria Ilieva
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Rasool
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or