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

how to show RadGridView in ComboBox DataTemplate

4 Answers 115 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.
Chetan
Top achievements
Rank 1
Chetan asked on 23 Nov 2010, 02:31 PM
Hi,

Is it possible to show RadGridView control in GridViewComboBoxColumn DataTemplate ?

my requirement is , on selecting combo box i need to show comboBox content in such a way that user can short , can search the records. i think RadGridView having all these functionality. currently i am showing TextBlock. Please check my code and let me know where i need to do changes.

DataTemplate for GridViewComboBoxColumn 

 

 

<DataTemplate x:Key="FeatureComboBoxCustomTemplate" >

 

 

 

 

<Grid>

 

 

 

 

<Grid.ColumnDefinitions>

 

 

 

 

<ColumnDefinition Width="50" />

 

 

 

 

<ColumnDefinition Width="350" />

 

 

 

 

<ColumnDefinition Width="150" />

 

 

 

 

</Grid.ColumnDefinitions>

 

 

 

 

<Border >

 

 

 

 

<TextBlock Text="{Binding FeatureNumber}"

 

 

 

HorizontalAlignment="Left" />

 

 

 

 

</Border>

 

 

 

 

<Border Grid.Column="1" >

 

 

 

 

<TextBlock Text="{Binding FeatureName}" HorizontalAlignment="Left" Margin="6,0,0,0" />

 

 

 

 

</Border>

 

 

 

 

<Border Grid.Column="2" >

 

 

 

 

<TextBlock Text="{Binding UseCaseName}" HorizontalAlignment="Left" Margin="6,0,0,0" />

 

 

 

 

</Border>

 

 

 

 

 

</Grid>

 

 

 

 

</DataTemplate>

 

 




Combo BOx

 

 

<!--Feature Name-->

 

 

 

 

<telerik:GridViewComboBoxColumn

 

 

 

UniqueName="Feature Name"

 

 

 

SelectedValueMemberPath="FeatureID"

 

 

 

DisplayMemberPath="FeatureName" IsResizable="False"

 

 

 

DataMemberBinding="{Binding FeatureID,Mode=TwoWay}"

 

 

 

ItemTemplate="{StaticResource FeatureComboBoxCustomTemplate}"

 

 

 

Width="180"

 

 

 

IsReadOnlyBinding="{Binding Path=., Converter={StaticResource GridRowReadOnlyConvertor}}">

 

 

 

 

<telerik:GridViewComboBoxColumn.Header>

 

 

 

 

<StackPanel>

 

 

 

 

<TextBlock Text="Feature Name" VerticalAlignment="Center" TextWrapping="Wrap" />

 

 

 

 

<TextBlock Text="*" Foreground="Red" />

 

 

 

 

</StackPanel>

 

 

 

 

</telerik:GridViewComboBoxColumn.Header>

 

 

 

 

</telerik:GridViewComboBoxColumn>


thanks

 

 

4 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 23 Nov 2010, 02:35 PM
Hi,

 You can use the approach from in this blog post in a custom CellTemplate of a GridViewDataColumn.

Greetings,
Vlad
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Chetan
Top achievements
Rank 1
answered on 23 Nov 2010, 05:12 PM
hi,

i have tried same but at runtime(code behind) i am not able to access combobox control which is inside Gridviewdatacolumn > cell template.

could you pls tell me how to access GridViewDataColumn>Cell Template on GridRowLoading or loaded?

Waiting for reply.

thanks
Csingh
0
Vlad
Telerik team
answered on 23 Nov 2010, 05:14 PM
Hello,

 Maybe it will be better if you create your own column similar to the approach demonstrated on this blog post

Best wishes,
Vlad
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Chetan
Top achievements
Rank 1
answered on 23 Nov 2010, 05:20 PM

Could you please share some sample of code?



thanks
Csingh
Tags
GridView
Asked by
Chetan
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Chetan
Top achievements
Rank 1
Share this question
or