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

[Solved] Export Combobox string values?

5 Answers 135 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Barry Hester
Top achievements
Rank 2
Barry Hester asked on 22 Jul 2009, 03:47 PM
Hello,

I have a GridViewComboBoxColumn in my grid:

<tGrid:GridViewComboBoxColumn HeaderText="Instrument" 
                                              UniqueName="Instrument" 
                                              DataMemberBinding="{Binding Instrument, Mode=TwoWay}" 
                                              SelectedValueMemberPath="InstrumentId" 
                                              DisplayMemberPath="Instrument"/> 

This works correctly, and I am able to save values to the underlying business object.  However, the export functionality uses the number value of instrumentId when building it's export string.  Is there any way that I can make it use the string value in the combobox when exporting?

Thanks!

5 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 28 Jul 2009, 05:55 AM
Hello Barry,

You can change the binding just before exporting and restore it later:

                GridViewComboBoxColumn column = (GridViewComboBoxColumn) RadGridView1.Columns["Instrument"];
                var binding = column.DataMemberBinding;
                column.DataMemberBinding = new Binding("YourProperty");

                // export goes here

                column.DataMemberBinding = binding;


Greetings,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Barry Hester
Top achievements
Rank 2
answered on 31 Jul 2009, 06:53 PM
Vlad,

Thanks for your reply, but I'm still a little confused. in your example, 'new Binding("YourProperty")' I need YourProperty to be the selected value of the dropdown.  So I'm still not sure what object/property I would point the binding at.

Thanks!
0
Vlad
Telerik team
answered on 06 Aug 2009, 08:53 AM
Hi Barry,

We fixed this issue and the fix will be part of our upcoming service pack. I've added 2000 Telerik points to your account.

All the best,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Barry Hester
Top achievements
Rank 2
answered on 06 Aug 2009, 10:07 PM
Thanks for the points, Vlad!

Any idea when the service pack is coming out? 

0
Vlad
Telerik team
answered on 07 Aug 2009, 05:19 AM
Hello Barry,

The service pack will be uploaded in the middle of the next week.

Kind regards,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
Barry Hester
Top achievements
Rank 2
Answers by
Vlad
Telerik team
Barry Hester
Top achievements
Rank 2
Share this question
or