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
2275
Adding XamComboEditor to a column in my XamDataGrid
posted

I'm trying to add a column to my XamDataGrid that is a XamComboEditor but can't seem to quite get how to do it simply.  My XamDataGrid code is:

<igDP:XamDataGrid Grid.Row="0" 
				  HorizontalAlignment="Stretch" 
				  Name="dgPDUsers"
				  DataSource="{Binding}"
				  IsSynchronizedWithCurrentItem="True" 
				  HorizontalContentAlignment="Stretch" 
				  VerticalContentAlignment="Stretch">
	
	<igDP:XamDataGrid.FieldLayouts>
		<igDP:FieldLayout Key="Expanded">
			<igDP:FieldLayout.Fields>
				<igDP:Field Name="PDUserID" Label="User ID" Width="80" IsPrimary="True" IsScrollTipField="True" />
				<igDP:Field Name="Name" Label="Name" Width="180" />
				<igDP:Field Name="Clinics" Label="Clinics">
					<igDP:Field.Settings>
						<igDP:FieldSettings EditorType="{x:Type igEditors:XamComboEditor}">
							<igDP:FieldSettings.EditorStyle>
								<Style TargetType="{x:Type igEditors:XamComboEditor}">
									<Setter Property="ItemsSource" Value="{Binding}" />
									<Setter Property="DisplayMemberPath" Value="Name" />
									<Setter Property="ValuePath" Value="ClinicID" />
								</Style>
							</igDP:FieldSettings.EditorStyle>
						</igDP:FieldSettings>
					</igDP:Field.Settings>
				</igDP:Field>
				<igDP:Field Name="ActiveName" Label="Active" Width="80" />
			</igDP:FieldLayout.Fields>
		</igDP:FieldLayout>
	</igDP:XamDataGrid.FieldLayouts>

	<igDP:XamDataGrid.FieldSettings>
		<igDP:FieldSettings CellClickAction="SelectRecord" 
							LabelClickAction="SortByMultipleFields"  
							AllowEdit="False"
							AllowRecordFiltering="True" />
	</igDP:XamDataGrid.FieldSettings>

	<igDP:XamDataGrid.FieldLayoutSettings>
		<igDP:FieldLayoutSettings AutoGenerateFields="False" 
								  HighlightAlternateRecords="True" 
								  AllowDelete="False" 
								  FilterClearButtonLocation="RecordSelector" 
								  FilterRecordLocation="OnTopFixed" 
								  FilterUIType="Default" />
	</igDP:XamDataGrid.FieldLayoutSettings>

</igDP:XamDataGrid>
My page behind is handling the UserControl_Loaded event thusly:
private void UserControl_Loaded( object sender, RoutedEventArgs e )
{
	PDUser p = new PDUser();
	List<PDUser> Users = p.SelfListAll();
	this.dgPDUsers.DataContext = Users;
}
the PDUser object has your garden variety properties; int, string and ect.  It also has a List<Clinic> 
property that is a list of Clinic object with a int ClinicID and string Name properties.
Given that I am just learning WPF and the Infragistics library, what would be the most simple way to
get my list of clinics in a combo box?
As it stands now, the rows in the data grid show up with plus marks on the left side, and when you 
click on them they expand but nothing is there. I don't want that to show, just the combo boxes.
Thanks.