Hello.
I was wondering how could I have a DataFormDataField or DataFormComboBox which could let me have a selection control(ComboBox or DropDownButton) which had a GridView in the dropdown list, so I can filter and group the information, and keeping the label of this dataformdatafield.
I was wondering how could I have a DataFormDataField or DataFormComboBox which could let me have a selection control(ComboBox or DropDownButton) which had a GridView in the dropdown list, so I can filter and group the information, and keeping the label of this dataformdatafield.
3 Answers, 1 is accepted
0
Hello Ivan,
Kind regards,
Maya
the Telerik team
You can place a RadComboBox directly in DataFormDataField and place RadGridView inside this RadComboBox's Template. It could be something like follows:
<telerik:DataFormComboBoxField > <telerik:RadComboBox> <telerik:RadComboBox.Template> <ControlTemplate> <telerik:RadGridView /> </ControlTemplate> </telerik:RadComboBox.Template> </telerik:RadComboBox> </telerik:DataFormComboBoxField>Kind regards,
Maya
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Ivan
Top achievements
Rank 1
answered on 28 Nov 2011, 08:53 PM
Hello, thanks for the quick reply.
I've already replaced the DataFormComboBoxField with the new RadComboBox, which is working alright, but it still shows the dropdown list it displayed before.
I replaced this line
with these
and the RadComboBox's controltemplate is ignored.
Could you be a little more specific on how to replace the list with the RadGridView?
I've already replaced the DataFormComboBoxField with the new RadComboBox, which is working alright, but it still shows the dropdown list it displayed before.
I replaced this line
<telerik:DataFormComboBoxField Name="DataCB" DataMemberBinding="{Binding DataId}" Label="Data" Loaded="DataCB_Loaded" SelectedValuePath="Id" />with these
<telerik:DataFormComboBoxField Name="DataCB" Label="Data">
<telerik:RadComboBox Loaded="DataCB_Loaded" SelectedValuePath="Id" SelectedValue="{Binding DataId}">
<telerik:RadComboBox.Template>
<ControlTemplate TargetType="telerik:RadComboBox">
<telerik:RadGridView ItemsSource="{TemplateBinding ItemsSource}" Height="200" AutoGenerateColumns="False">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Property1}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Property2}" />
</telerik:RadGridView.Columns>
</telerik:RadGridView>
</ControlTemplate>
</telerik:RadComboBox.Template>
</telerik:RadComboBox>
</telerik:DataFormComboBoxField>and the RadComboBox's controltemplate is ignored.
Could you be a little more specific on how to replace the list with the RadGridView?
0
Hi Ivan,
and everything works as expected on my side. What are the difficulties that you encountered ?
Nevertheless, I would recommend you to run through this blog post for further reference and try to implement the same idea.
Greetings,
Maya
the Telerik team
I have tested the scenario with setting DataFormComboBoxField as follows:
<telerik:DataFormComboBoxField > <telerik:DataFormComboBoxField.ContentTemplate> <DataTemplate> <telerik:RadComboBox > <telerik:RadComboBox.Template> <ControlTemplate> <telerik:RadGridView /> </ControlTemplate> </telerik:RadComboBox.Template> </telerik:RadComboBox> </DataTemplate> </telerik:DataFormComboBoxField.ContentTemplate></telerik:DataFormComboBoxField>and everything works as expected on my side. What are the difficulties that you encountered ?
Nevertheless, I would recommend you to run through this blog post for further reference and try to implement the same idea.
Greetings,
Maya
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>