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
40
how bind composite object to xamDataGrid cells
posted

I should add xamTextEditor column to xamDataGrid . i used  CellValuePresenter.

 

 

 

 

 

 

 

<

 

 

Style x:Key="SalesPrice_CellValuePresenterStyle" TargetType="{x:Type igDP:CellValuePresenter}" >

 

 

 

 

 

<Style.Resources>

 

 

 

 

<DataTemplate x:Key="SalesPriceStyleNoDataTemplate">

 

 

 

 

<igEditors:XamNumericEditor Value="{Binding Path =Host.Record.DataItem.SalesPrice.OldValue}" />

 

 

 

 

</DataTemplate>

 

 

 

 

</Style.Resources>

 

 

 

 

<Setter Property="ContentTemplate" Value="{StaticResource SalesPriceStyleNoDataTemplate}"/>

 

 

 

 

</Style>

and my gridfield difinition is

 

 

 

 

 

 

 

 

 

 

<igDP:Field Name="SalesPrice" Label="Sales Price" Width="Auto" >

 

 

 

 

<igDP:Field.Settings>

 

 

 

 

<igDP:FieldSettings EditorType="{x:Type igEditors:XamTextEditor}" AllowEdit="True" EditAsType="{x:Type System:Decimal}"

 

 

 

CellValuePresenterStyle="{StaticResource SalesPrice_CellValuePresenterStyle}" />

 

 

 

 

</igDP:Field.Settings>

the problem is new row is not added.  i added the tags also

 

 

 

<igDP:XamDataGrid.FieldLayoutSettings>

 

 

 

<igDP:FieldLayoutSettings AutoGenerateFields="False" SelectionTypeRecord="Single"

 

 

AddNewRecordLocation="OnBottom" AllowAddNew="True"

 

 

AllowDelete="True"  HighlightAlternateRecords="True"/>

 

 

 

</igDP:XamDataGrid.FieldLayoutSettings>

 

 

 

 

 

</igDP:Field>