Which control should I use in WPF browser application to get multi column Combo Box?
Thanks
Shivangi
Hello Shivangi,
I have been looking into your enquiry and since there is no such built-in functionality I can suggest you start off with the XamComboEditor and use its ComboBoxStyle property to set a style that can retemplate your items to your liking. Here is a sample xaml snippet you can check out:
<igEditors:XamComboEditor … >
<igEditors:XamComboEditor.ComboBoxStyle>
<Style TargetType="ComboBox">
<Setter Property="ItemTemplate" >
<Setter.Value>
<DataTemplate >
<StackPanel Orientation="Horizontal" Background="YellowGreen" >
<TextBox Width="60" Margin="1" />
</StackPanel>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</igEditors:XamComboEditor.ComboBoxStyle>
</igEditors:XamComboEditor>
Hope this helps. Please let me know if you require any further assistance or clarification on the matter.
Sincerely,
Petar Monov
Developer Support Engineer
Infragistics Bulgaria
www.infragistics.com/support
Hello Petar,Thank you for the response.When I tried to use your suggested code my application throws following error at <DataTemplate>:
"System.Windows.Markup.XamlParseException was unhandledMessage: Cannot create instance of 'Page1' defined in assembly 'TestApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Exception has been thrown by the target of an invocation. Error in markup file 'Page1.xaml' Line 1 Position 7."
Here is my code:
<StackPanel Margin="261,10,50,43" MinWidth="0" Orientation="Vertical" Opacity="1" Grid.ColumnSpan="1" Grid.RowSpan="1" CanHorizontallyScroll="True" CanVerticallyScroll="True" VerticalAlignment="Stretch">
<igEditors:XamDateTimeEditor Height="35" Name="dtFromDate" Width="255" Padding="10" Margin="2" FontSize="9" AutoFillDate="MonthAndYear" FontWeight="Bold" AlwaysValidate="True" />
<igEditors:XamDateTimeEditor Height="35" Name="dtToDate" Width="255" Padding="10" Margin="2" FontSize="9" FontWeight="Bold" AlwaysValidate="True" AutoFillDate="MonthAndYear"></igEditors:XamDateTimeEditor>
<igEditors:XamComboEditor Height="35" Name="ceEmployeeName" Width="253" Margin="2" FontSize="9" FontWeight="Bold"> <igEditors:XamComboEditor.ComboBoxStyle> <Style TargetType="ComboBox"> <Setter Property="ItemTemplate"> <Setter.Value> <DataTemplate> <StackPanel Orientation="Horizontal" Background="Yellow"> <TextBox Width="60" Margin="1"/> <TextBox Width="60" Margin="1"/> <TextBox Width="60" Margin="1"/> </StackPanel> </DataTemplate> </Setter.Value> </Setter> </Style> </igEditors:XamComboEditor.ComboBoxStyle> </igEditors:XamComboEditor>
ThanksShivangi
Hi Shivangi,
Yes. You need a DataSource with at least one item. And for in order to get the specific data from the item you should also add some Bindings to the TextBoxes inside the template.
Please update me whether you got the needed result.
Regards Petar.
Petar,
I could remove the error by deleting other code, and my application is running without any issues now.
But when I run it , it does not show multicolum or anything in combobox dropdown, Do I have to assign datasource to see any changes?
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.
If the above suggestion helped you solve your issue please verify the thread as answered so other users may take better advantage of it.
Sincerely,Petar MonovDeveloper Support EngineerInfragistics Bulgariawww.infragistics.com/support
I copy/pasted the xaml snippet in my test sample and everything worked ok. This exception usually indicates a mistyping in the markup. I can suggest looking through your project to see if you are not missing a closing tag or something similar outside the xaml snippet you have sent.
Please double check that and let me know of the result.