PropertyGridPropertyItem + DateTimeEditBox

Grids for WPF Forum

Posted 7 years ago by Valentin
Version: 12.1.0562
Avatar

Hello
I would like to know. How can I connect DateTimeEditBox to PropertyGridPropertyItem?
I'm trying to do it

        <propgrid:PropertyGrid>
            <propgrid:PropertyGrid.PropertyEditors>
                <propgrideditors:BrushPropertyEditor />
                <propgrideditors:ColorPropertyEditor />
                <propgrideditors:DateTimePropertyEditor />
                <propgrideditors:DoublePropertyEditor />
                <propgrideditors:EnumPropertyEditor />
                <propgrideditors:GuidPropertyEditor />
                <propgrideditors:Int32PropertyEditor />
                <propgrideditors:Int32RectPropertyEditor />
                <propgrideditors:NullableColorPropertyEditor />
                <propgrideditors:NullableDateTimePropertyEditor />
                <propgrideditors:NullableDoublePropertyEditor />
                <propgrideditors:NullableGuidPropertyEditor />
                <propgrideditors:NullableInt32PropertyEditor />
                <propgrideditors:NullableInt32RectPropertyEditor />
                <propgrideditors:NullablePointPropertyEditor />
                <propgrideditors:NullableRectPropertyEditor />
                <propgrideditors:NullableSizePropertyEditor />
                <propgrideditors:NullableTimeSpanPropertyEditor />
                <propgrideditors:NullableVectorPropertyEditor />
                <propgrideditors:PointPropertyEditor />
                <propgrideditors:RectPropertyEditor />
                <propgrideditors:SizePropertyEditor />
                <propgrideditors:TimeSpanPropertyEditor />
                <propgrideditors:VectorPropertyEditor />
            </propgrid:PropertyGrid.PropertyEditors>

            <propgrid:PropertyGrid.Items>
                <propgrid:PropertyGridPropertyItem DefaultValue="DefaultValue1"
                                                   Description="This is the first property."
                                                   ValueName="Date"
                                                   Value="{Binding ViewModel.Date}">
                </propgrid:PropertyGridPropertyItem>
            </propgrid:PropertyGrid.Items>
        </propgrid:PropertyGrid>
    </Grid>

 Or

        <propgrid:PropertyGrid>

            <propgrid:PropertyGrid.Items>
                <propgrid:PropertyGridPropertyItem DefaultValue="DefaultValue1"
                                                   Description="This is the first property."
                                                   ValueName="Date"
                                                   Value="{Binding ViewModel.Date}">
                    <propgrid:PropertyGridPropertyItem.ValueTemplate>
                        <DataTemplate>
                            <editors:DateTimeEditBox/>
                        </DataTemplate>
                    </propgrid:PropertyGridPropertyItem.ValueTemplate>
                </propgrid:PropertyGridPropertyItem>
            </propgrid:PropertyGrid.Items>
        </propgrid:PropertyGrid>
    </Grid>

 

But unfortunately it does not work.

Comments (1)

Answer - Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Valentin,

Try adding this to the PropertyGridPropertyItem:

ValueType="{x:Type sys:DateTime}"

That should get it showing.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.