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
490
how to specify custom templating mechanism to a field template inside a xamdatagrid
posted

how to specify custom templating mechanism to a field template or if it is possible to do as follows to specify stackpanel?

<my:XamDataGrid Height="103" Margin="12,25,92,0" Name="xamDataGrid1" VerticalAlignment="Top" DataSource="{Binding Path=.}">

<my:XamDataGrid.FieldLayoutSettings>

<my:FieldLayoutSettings x:Uid="my:FieldLayoutSettings_1" AutoArrangeCells="Never" AutoGenerateFields="False" />

</my:XamDataGrid.FieldLayoutSettings>

<my:XamDataGrid.FieldLayouts>

<my:FieldLayout x:Uid="my:FieldLayout_1">

<my:FieldLayout.Fields>

<StackPanel><Label>Hello Description</Label><my:Field Name="appdesc" /> </StackPanel>

<my:Field Name="appdesccode"/>

</my:FieldLayout.Fields>

</my:FieldLayout>

</my:XamDataGrid.FieldLayouts>

</my:XamDataGrid>

  • 8576
    Offline posted
    Hi Vairam -
     
    The element that presents Field data is called the CellValuePresenter.  So to re-template the contents of a Field you would need to create a Style for the CellValuePresenter that sets a new Template with the elements of your choice, and then set that Style on the Field.Settings.CellValuePresenterStyle property.
     
    If you search the forum for CellValuePresenter you will see numerous posts that show how to do this.
     
    Joe