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

Export Excel GridTemplateColumn + RadComboBox

3 Answers 236 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Lasly
Top achievements
Rank 1
Lasly asked on 12 Mar 2012, 03:24 PM
Hi ,
When I Export to Excel from a  RadGrid then everything is fine, but if I Export RadGrid with GridTemplateColumn and RadComboBox as an  ItemTemplate, then the Value, DataValueField  ,of the RadComboBox  it show instead of the DataTextField.
How can extract the radcombox  DataTextField instead of  DataValueField  ?
thanks

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 13 Mar 2012, 06:04 AM
Hello,

Try the following.
ASPX:
<telerik:RadGrid ID="radgrid1" runat="server" DataSourceID="SqlDataSource1">
  <ExportSettings ExportOnlyData="false" Excel-Format="Html">
  </ExportSettings>
  <MasterTableView CommandItemDisplay="Top">
    <CommandItemSettings ShowExportToExcelButton="true" />
    <Columns>
      <telerik:GridTemplateColumn HeaderText="test">
        <ItemTemplate>
          <telerik:RadComboBox ID="RadComboBox1" runat="server" DataSourceID="SqlDataSource1" DataTextField="LastName" DataValueField="EmployeeID">
          </telerik:RadComboBox>
        </ItemTemplate>
      </telerik:GridTemplateColumn>
    </Columns>
  </MasterTableView>
</telerik:RadGrid>

Thanks,
Princy.
0
Lasly
Top achievements
Rank 1
answered on 13 Mar 2012, 10:20 AM
Many thanks for your answer, but does not work:
 1) export the DataTextField, but of all the items of radcombobox
 2) export the combo box and the select button. (+ All the buttons, because ExportOnlyData = "false")

does it work for You?

How do i solve this? ( I have so many pages with this problem)

 


thank you very much
0
Daniel
Telerik team
answered on 16 Mar 2012, 10:02 AM
Hi Lasly,

I created a simple demo based on the code posted by Princy. Please test it locally and see if it helps.

Regards,
Daniel
the Telerik team
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 their blog feed now.
Tags
Grid
Asked by
Lasly
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Lasly
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or