Click here to Skip to main content
15,844,903 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have WPF grid, in which i have 3 columns
Field Name Field Value (cell control type) DataType
-----------------------------------------------------------------
PeronName Timo (Textbox) string
PersonID 1034 (Textbox) Numeric
Birth Date 10 Dec 1985(Date with Calendar) DateTime
IsMarried Yes(checkbox) boolean

Field Name and data type are read only columns,
User will enter value in "Field Value" column
If field value can have either textbox or checkbox or calendar control in a cell.
How it is possible. P
Please advice
Posted

1 solution

Use a DataGridTemplateColumn and have all three controls in it.
e.g.

<dg:DataGridTemplateColumn MaxWidth="250" Header="Picture">

<dg:DataGridTemplateColumn.CellEditingTemplate>

<DataTemplate>
<StackPanel Orientation='Horizontal'>
<!--Have all three controls here and show/hide them as required-->
</StackPanel>
</DataTemplate>
<dg:DataGridTemplateColumn.CellEditingTemplate>

Pick and choose one of them as you require.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900