Hello
I wonder how to use a combo as celleditor in a datagrid column
I know that there is a XamCombo, but I use the Express version which lacks this control
Could you provide a simple example how to accomplish this with Express?
Regards
Klaus
Hello Alex,
using a XamNumericEditor in XamDataGrid (as in your XDG solution) leads for me to the following problem.The Department column get's a HorizontalContentAlignment Right although I set it in XAML to Left. I would be happy to get some help from you. You can see the Problem at the provided screenshot.
GreetingsHannes
Hi
I am using same code to bind editor combobox in xamdatagrid
But i am facing one issue first time when i clicked on that editable row it is hiding that window
Scnerio - I have a main window and i opened a child window in child i have a xamdatagrid and in that one column is State and want to change that state when i click on that state's column that child window is hide under main window,
Code:
<Window.Resources><ObjectDataProvider x:Key="DdApItem" ObjectType="{x:Type local:ClsVmpInvDtl}" /> <Style TargetType="ComboBox" x:Key="ComboStyle1"> <Setter Property="ItemTemplate"> <Setter.Value> <DataTemplate> <StackPanel Orientation="Horizontal"> <Border BorderThickness="0.5" BorderBrush="Black"> <TextBlock Text="{Binding TaxCodeID}" Width="100" /> </Border> <TextBlock Text="{Binding Description}" Width="auto" /> </StackPanel> </DataTemplate> </Setter.Value> </Setter> </Style> <Style TargetType="{x:Type igEditors:XamNumericEditor}" x:Key="TaxItemComboBoxEditor"> <Setter Property="EditTemplate"> <Setter.Value> <ControlTemplate TargetType="{x:Type igEditors:XamNumericEditor}"> <StackPanel> <ComboBox x:Name="cboComboboxEditor" DisplayMemberPath="TaxCodeID" SelectedValuePath="TaxCodeID" ItemsSource="{Binding Source={StaticResource DdApItem}, Path=DtTaxItems}" SelectedValue="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Value, Mode=TwoWay}" IsEditable="True" Style="{StaticResource ComboStyle1}" AlternationCount="2" Width="auto" /> </StackPanel> </ControlTemplate> </Setter.Value> </Setter> <Setter Property="HorizontalContentAlignment" Value="Left"/> </Style></Window.Resources><igDP:XamDataGrid x:Name="XamDGPInv" Theme="Print Basic" GroupByAreaLocation="None" AutoFit="True" Margin="9,224,18,66" Style="{StaticResource customBackground}" Grid.Column="1">
<igDP:Field Name="TaxCodeID" Label="Tax Code" Width="140"> <igDP:Field.Settings> <igDP:FieldSettings EditorStyle="{StaticResource ResourceKey=TaxItemComboBoxEditor}" /> </igDP:Field.Settings> </igDP:Field>
</igDP:XamDataGrid>
Hi,
In the above code, the user selects a Department as a string but the stored value is the translated ID (which is a numeric). How do I make it to accept the user selected string as it is? Thanks.
You can try this as well : http://blogs.infragistics.com/blogs/andrew_smith/archive/2009/03/27/hosting-wpf-controls-in-a-xamdatagrid-cell.aspx
Using this host editor, you will have to define two templates - edit mode and template, just as your requirement is.
It is just a dummy code but what I am trying to do is display two different controls on normal (not edit) and edit mode. And by playing dynamically with AllowEdit FieldSettings' property, in certain situation I would permit edition or not. Is it possible? Do you have a suggestion how to make this work.