Project Background
Facts About Project
Question
XAML CODE:
<igCombo:XamWebComboEditor Name="IngredientTypeComboEditor" />
<igGrid:XamWebGrid.Columns>
<igGrid:TextColumn Key="Code" HeaderText="Code" Width="Auto" MinimumWidth="20" />
<igGrid:TextColumn Key="TitleAR" HeaderText="Name Arabic" Width="Auto" MinimumWidth="150" />
<igGrid:TextColumn Key="TitleEN" HeaderText="Name English" Width="Auto" MinimumWidth="150" />
<igGrid:TemplateColumn.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=???, Source={???}}" /> </DataTemplate>
</igGrid:TemplateColumn.ItemTemplate>
<igGrid:TemplateColumn.EditorTemplate>
<ComboBox Name="ComboIngredientType" ItemsSource="{Binding ???}" />
</DataTemplate>
</igGrid:TemplateColumn.EditorTemplate>
</igGrid:TemplateColumn>
</igGrid:XamWebGrid>
VB CODE:
Dim SRV As New DomainService1
Private Sub LoadData()
Me.grdList.ItemsSource = SRV.Ingredients
Me.IngredientTypeComboEditor.ItemsSource = SRV.D_IngredientTypes
Me.IngredientTypeComboEditor.DisplayMemberPath = "TitleEN"
SRV.Load(SRV.GetD_IngredientTypeQuery)
End Sub
Hi,
Thats b/c you don't have an EditorTemplate defined for your DepartmentID column, so the columns is not editable.
-SteveZ
Hi here is my xaml for this case:
<ig:XamGrid ItemsSource="{Binding EmployeeDepartments}" AutoGenerateColumns="false" CellEnteredEditMode="XamGrid_CellEnteredEditMode"><ig:XamGrid.EditingSettings> <ig:EditingSettings AllowEditing="Row" IsMouseActionEditingEnabled="DoubleClick" IsEnterKeyEditingEnabled="True" IsF2EditingEnabled="True" IsOnCellActiveEditingEnabled="False" /></ig:XamGrid.EditingSettings><ig:XamGrid.Columns> <ig:TemplateColumn Key="PrimaryInd" > <ig:TemplateColumn.HeaderTemplate> <DataTemplate> <TextBlock Text="{Binding ghPrimaryInd, Source={StaticResource localizedStrings}}" HorizontalAlignment="Center" /> </DataTemplate> </ig:TemplateColumn.HeaderTemplate> <ig:TemplateColumn.ItemTemplate> <DataTemplate> <RadioButton IsChecked="{Binding PrimaryInd,Mode=TwoWay}" HorizontalAlignment="Center" VerticalAlignment="Center"/> </DataTemplate> </ig:TemplateColumn.ItemTemplate> </ig:TemplateColumn> <ig:TemplateColumn Key="DepartmentID" > <ig:TemplateColumn.HeaderTemplate> <DataTemplate> <TextBlock Text="{Binding ghDepartment, Source={StaticResource localizedStrings}}" HorizontalAlignment="Center" /> </DataTemplate> </ig:TemplateColumn.HeaderTemplate> <ig:TemplateColumn.ItemTemplate> <DataTemplate> <ComboBox x:Name="TheDepartments" DisplayMemberPath="DepartmentName" /> </DataTemplate> </ig:TemplateColumn.ItemTemplate> </ig:TemplateColumn> <ig:TextColumn Key="Department.DepartmentName" > <ig:TextColumn.HeaderTemplate> <DataTemplate> <TextBlock Text="{Binding ghDepartment, Source={StaticResource localizedStrings}}" HorizontalAlignment="Center" /> </DataTemplate> </ig:TextColumn.HeaderTemplate> </ig:TextColumn> </ig:XamGrid.Columns></ig:XamGrid>
here is the code as you suggested:
private void XamGrid_CellEnteredEditMode(object sender, Infragistics.Controls.Grids.EditingCellEventArgs e) { if (e.Cell.Column.Key == "DepartmentID") { ((ComboBox)e.Editor).ItemsSource = ((MyViewModel)this.DataContext).Departments; } }
When debugging the app, (e.Cell.Column.Key == "DepartmentID") never happened. Double click on the column for combobox, even not trigger above event CellEnteredEditMode.
I'm not sure what you're asking.
All columns thats are editable, support double click editing. (Note you need to make sure that on your Editing settings you have MouseClickAction set to double, however that is the default)
Also, for TemplateColumns and UnboundColumns, they are editiable if and only if you have the EditorTemplate set.
Could you be more specific with your case and the problem you're running into?
If use CellEnteredEditModeevent, this event will be triggered by double click on any editable cell like TextBox, but above templateCoulmn not support double click event to enter Edit Mode.
How to resolve this problem?
Hi Shahzad,
The CellEnteredEditMode event fires for each cell in view on the Add New Row.
So the same approach will work.