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
105
Custom value editor in XamDataGrid
posted

Normal 0 false false false EN-GB X-NONE X-NONE MicrosoftInternetExplorer4

Hi,

I have a WPF XamDataGrid where I want to use a custom usercontrol for one of the column cell editors. Values are enumerations.

 

Currently I have it working displaying text as below:

<igDP:FieldLayout.Fields>

       <igDP:Field  Name="Relation">

              <igDP:Field.Settings>

                     <igDP:FieldSettings EditorType="{x:Type igEditors:XamComboEditor}">

                           <igDP:FieldSettings.EditorStyle>

                                  <Style TargetType="{x:Type igEditors:XamComboEditor}">

                                         <Setter Property="ItemsProvider" Value="{StaticResource SpatialRelationKey}" />

                                  </Style>

                           </igDP:FieldSettings.EditorStyle>

                     </igDP:FieldSettings>

              </igDP:Field.Settings>

       </igDP:Field>

</igDP:FieldLayout.Fields>

 

SpatialEnum is very similar to Anchor propery in WinForms. I want to be able to edit it in the same way you can set Anchor propery from within VisualStudio.

For that purpose I have created a user control with a 3x3 grid of ToggleButtons and one dependency property SpatialRelationProperty.

public static readonly DependencyProperty SpatialRelationProperty = DependencyProperty.Register("SpatialRelation", typeof(SpatialRelationEnum), typeof(AnchorUserControl), new PropertyMetadata(SpatialRelationChanged));


Please could you advise the best way/which XamDataGrid property I need to set so that my custom UserControl gets used as the editor for the “Relation” field?

Many thanks.

 

 

Parents Reply Children
No Data