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

SelectedItem of gridview inside combo

3 Answers 109 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Gilberto
Top achievements
Rank 1
Gilberto asked on 23 Aug 2011, 03:33 PM
I am using one grid inside radcombobox just like the xaml bellow.

      

  
<telerik:RadComboBox DisplayMemberPath="Descricao" Name="radComboBoxResultado" Grid.Column="2" StaysOpenOnEdit="True" Height="26">             <telerik:RadComboBox.Items>                 <telerik:RadComboBoxItem>                     <telerik:RadComboBoxItem.Template>                         <ControlTemplate>                             <Grid>                                 <Grid.RowDefinitions>                                     <RowDefinition Height="*"></RowDefinition>                                     <RowDefinition Height="*"></RowDefinition>                                 </Grid.RowDefinitions>                                 <telerik:RadGridView  x:Name="RadGridView" AutoGenerateColumns="False" ShowGroupPanel="False" CanUserFreezeColumns="False"                                               RowIndicatorVisibility="Collapsed" IsReadOnly="True" MinWidth="300" MaxWidth="600"                                              IsFilteringAllowed="False" ItemsSource="{Binding PagedSource, ElementName=RadDataPager}" SelectionChanged="RadGridView_SelectionChanged"                                              Height="150" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" Loaded="RadGridViewResultadoBusca_Loaded">                                     <telerik:RadGridView.Columns>                                         <telerik:GridViewDataColumn Header="ReferĂȘncia" Width="120" DataMemberBinding="{Binding CodigoProduto}" IsReadOnly="True"></telerik:GridViewDataColumn>                                         <telerik:GridViewDataColumn Header="Produto" Width="*" DataMemberBinding="{Binding Descricao}" IsReadOnly="True"></telerik:GridViewDataColumn>                                         <telerik:GridViewDataColumn Header="Venda" Width="*" DataMemberBinding="{Binding ValorVenda}" DataFormatString="C2"  IsReadOnly="True"></telerik:GridViewDataColumn>                                     </telerik:RadGridView.Columns>                                 </telerik:RadGridView>                                 <telerik:RadDataPager Name="RadDataPager" Grid.Row="1" DisplayMode="FirstLastNumeric,Last" PageSize="20" Loaded="RadDataPager_Loaded"></telerik:RadDataPager>                             </Grid>                         </ControlTemplate>                     </telerik:RadComboBoxItem.Template>                 </telerik:RadComboBoxItem>             </telerik:RadComboBox.Items>         </telerik:RadComboBox>



Everything is ok but when i select the row in grid i'd like the text to appear in Text property of RadcomboBox  .

I've tried to binding the selected items together, and does not works, as well as, implement the selectedChnaged of the grid to set the combo.Text property with no success.


How can i achieve this?

Thanks

3 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 25 Aug 2011, 11:58 AM
Hi Gilberto,

Please check this blog post where a similar approach is demonstrated - note how the Text property of the RadComboBox is binded.

Hope this helps.

Kind regards,
Yana
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Jeff
Top achievements
Rank 1
answered on 04 Jun 2014, 06:58 PM
The new link to the blog post referenced above: http://blogs.telerik.com/vladimirenchev/posts/10-04-09/how-to-filter-as-you-type-radgridview-inside-radcombobox-for-wpf-and-silverlight.aspx
0
Yana
Telerik team
answered on 05 Jun 2014, 06:37 AM
Hello Jeff,

Thank you for re-posting the link.

Regards,
Yana
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
ComboBox
Asked by
Gilberto
Top achievements
Rank 1
Answers by
Yana
Telerik team
Jeff
Top achievements
Rank 1
Share this question
or