Our custom application uses the editor widget. Currently, the featuredataform that the widget uses formats and saves all datetimes as DateKind.Local. This isn't useful to us since whenever any datetimes are committed back to the database it is converted to DateKind.Utc.
What I'd like to do is capture an event or otherwise gain access to the underlying featuredataform that the editorwidget uses so that I can change the DateKind to UTC, but I can't see where that control is exposed in the editorwidget. Any advice?
You can download the source code from codeplex or Github for EditorWidget and FeatureDataForm.Basically, you can get access to FeatureDataForm through TemplatePicker class which is a component of EditorWidgetinternal static void ShowAttributeForm(FeatureLayer featureLayer, Graphic graphic)
{
#if SILVERLIGHT
ChildWindow window = new ChildWindow();
#else
Window window = new Window();
window.Owner = Application.Current.MainWindow;
window.WindowStartupLocation = WindowStartupLocation.CenterOwner;
window.SizeToContent = SizeToContent.WidthAndHeight;
window.ResizeMode = ResizeMode.NoResize;
#endif
FeatureDataForm form = new FeatureDataForm()
{
GraphicSource = graphic,
FeatureLayer = featureLayer,
IsReadOnly = !featureLayer.IsUpdateAllowed(graphic),
MaxWidth = 500,
MaxHeight = 500
};
window.Content = form;
form.EditEnded += (s, e) => { window.Close(); };
#if SILVERLIGHT
window.Show();
#else
window.ShowDialog();
#endif
}