Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • I have a converter that converts DateTime objects from utc time to local time and back from local to utc time. I've used this with a DateEdit and it works fine

                                            <Editors:DateEdit EditValue="{Binding Date,Converter={DateEditConverter:UtcToLocalConverter}}"
                                                              Mask="G"
                                                              MaskUseAsDisplayFormat="True"/>

                                    Now I want to use the same converter in a GridControl. But unfortunately I can't find a way to provide a converter for a GridColumn. The DisplayMemberBinding property makes the column read only, but it should be changable.

                                            <dxg:GridControl ItemsSource="{Binding Rows}">
                                                <dxg:GridControl.Columns>
                                                    <dxg:GridColumn FieldName="Date">
                                                        <dxg:GridColumn.EditSettings>
                                                            <Settings:DateEditSettings Mask="G"
                                                                                       MaskUseAsDisplayFormat="True" />
                                                        </dxg:GridColumn.EditSettings>
                                                    </dxg:GridColumn>
                                                </dxg:GridControl.Columns>
                                                <dxg:GridControl.View>
                                                    <dxg:TableView />
                                                </dxg:GridControl.View>
                                            </dxg:GridControl>

                                    Is it possible to use converters with your GridControl? Or do you have an idea how to do this date time conversion for the DateEdit control?

                                    I thought about writing my own UtcLocalDateEdit control, derived from DateEdit but unfortunately the documentation does not help moch for writing own editors. Do you have an example, how to do this. The documentation only decribes how to register a new editor.

                                    Kind regards
                                    Marcus

                                DateEditConverter.zip
                                0

                                Hello Marcus,

                                Thank you for the question. At the moment, the only solution to use unbound column. We plan to overcome this limitation in future releases: Provide the capability to apply a value converter (IValueConverter) to a grid column. Let me know if you need further assistance.

                                Thank you, Marina

                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2014 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners