This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Actually I have two questions : But I'll start with the first one : I have a DateTime object in my class. When I display it inside the property grid I can only select the date (day,month,year). How can I tell it to display time as well ?
My second question : It surely must be there, but I cannot find it : When I search in the forum I get results from all the forum products. But I only want answers from the property grid product..... anyone ? |
|
|
The property grid has a limited range of built-in editors, and the only built-in editor it provides for date-time values is a calendar (i.e. dates only, not times). For date-time editing, you would need to create a custom editor and hook it up via a PropertyEditor or TypeEditor declaration. Our WPF Elements product (http://www.mindscape.co.nz/products/WpfElements/default.aspx) includes a date-time editing control which is suitable for this; if you prefer a free/open source solution, you could check out Microsoft's WPF Toolkit (http://www.codeplex.com/wpf/Release/ProjectReleases.aspx), which contains a "DatePicker" control though I don't know if this supports times as well, and there are also third-party open source offerings (e.g. http://marlongrech.wordpress.com/2008/02/06/wpf-date-time-picker/). Or of course you can build your own possibly using one of these as a starting point. Let us know if you need any help integrating the control you choose into the grid (see http://www.mindscape.co.nz/blog/index.php/2008/01/23/editing-custom-types-in-the-wpf-property-grid/ and http://www.mindscape.co.nz/blog/index.php/2008/01/24/custom-property-editors-in-the-wpf-property-grid/ for starting points). I'll ask someone to get back to you about your forums search question (I don't know either!). |
|