Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
Combobox in DataGrid
posted

Helo!

I have a grid bind to a xml file X10MapData.

<X10Map xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="e:\xml\x10map.xsd">

<X10Element ID="X10CMD_VOL_UP">

<Command>X10CMD_VOL_UP</Command>

<Function>VolumeDown</Function>

<DefaultFunction>VolumeDown</DefaultFunction>

</X10Element>

<X10Element ID="X10CMD_VOL_DN">

<Command>X10CMD_VOL_DN</Command>

<Function>VolumeUp</Function>

<DefaultFunction>VolumeUp</DefaultFunction>

</X10Element>

</X10Map>

 

In second column I need a combobox.

I define a style for the "combobox-column":

<Style TargetType="{x:Type igDP:CellValuePresenter}" x:Key="Fkt">

<Setter Property="Template">

<Setter.Value>

<ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">

<ComboBox ItemsSource="{TemplateBinding Content}" IsSynchronizedWithCurrentItem="True" />

</ControlTemplate>

</Setter.Value>

</Setter>

</Style>

 

And here ist my DataGrid:

 

<igDP:XamDataGrid Grid.Column="1" Height="98" Name="xamDataGrid1" VerticalAlignment="Top"

DataSource="{Binding Source={StaticResource X10MapData}, XPath=X10Element}">

<igDP:XamDataGrid.FieldLayoutSettings>

<igDP:FieldLayoutSettings AutoGenerateFields="False" />

</igDP:XamDataGrid.FieldLayoutSettings>

<igDP:XamDataGrid.FieldLayouts>

<igDP:FieldLayout>

<igDP:FieldLayout.Fields>

<igDP:Field Name="Command" Label="Kommando" >

<igDP:Field.Settings>

<igDP:FieldSettings CellMinWidth="200" CellWidth="200" />

</igDP:Field.Settings>

</igDP:Field>

<igDP:Field Name="Function" Label="Funktion">

<igDP:Field.Settings>

<igDP:FieldSettings CellMinWidth="200" CellWidth="200" CellValuePresenterStyle="{StaticResource Fkt}" />

</igDP:Field.Settings>

</igDP:Field>

</igDP:FieldLayout.Fields>

</igDP:FieldLayout>

</igDP:XamDataGrid.FieldLayouts>

</igDP:XamDataGrid>

 

My problem: the combobox doesn't show the string "VolumeUp" (from xml file) in one line! Each letter (V,o,l,u,m,e,U,p) is a element of the combobox!

I hope you can help me!

Thanks,

Adi