I have a DataTatble with a DataColumn defined as
DataTable dt = new DataTable();
DataColumn dcPrice = new DataColumn("Price");
dcPrice.DataType = typeof(decimal);
dcPrice.DefaultValue = 54;
dt.Columns.Add(dcPrice);
I am binding it with XamDataGrid using
Xamgrid.DataSource = dt.Rows
The code in XAML is
<igDP:Field Name="Price" Label="TaxCode" >
<igDP:Field.Settings>
<igDP:FieldSettings />
</igDP:Field.Settings>
</igDP:Field>
Which is working fine but if I use unbooundfield like below
<igDP:UnboundField Name="Price" Label="Price" BindingPath="Price">
<igDP:UnboundField.Settings>
</igDP:UnboundField.Settings>
</igDP:UnboundField>
Or
<igDP:FieldSettings CellValuePresenterStyle="{StaticResource PriceCellStyle}" />
//Where PriceCellStyle is defined in Resources as
<Style x:Key="PriceCellStyle" TargetType="{x:Type igDP:CellValuePresenter}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
<StackPanel x:Name="stackPanel" Orientation="Horizontal">
<TextBox Text="{Binding Path=DataItem.Price}" ></TextBox>
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Its not showing the values then
I need to show TextBox in the grid binded with the “Price” column as defined in the datatable
Thanks in Advance,
Rehman Mansoor
Hi Joe
I am using the UnboundField definition because i need a TextBox and a Combo in the list and as far as i know we cant get combo in normal Field definition right?Thats why it is important to use CellValuePresenter template for Combo even if i dont use it for Texbox.