Hi guys,I'm hoping someone can help me out and also wondering if anyone else has come across this problem with auto populating fields in an EditAttributesDialog form.What I need to accomplish:Auto populate some fields (such as Date) any time an EditAttribuesDialog is used by the user. The fields would always be the same name, so there's no issue there.What I've done so far:I followed the AttributesExtension example and my project is now listening to the static event EditAttributesDialog.CreatingEditGroups += new EventHandler<CreatingEditGroupsEventArgs>(EditAttributesPage_CreatingEditGroupsEvent);
just as that example does. I created a method that fires when this event occurs, and this is where I put the code in to auto populate the date field. If I launch my application with my current code, edit a point, hit save, it works great.What I'm having a problem with:When making edits on the point, viewing the form, the form doesn't display the information that I have auto populated. For instance, I make an edit, the form comes up, I scroll to where the date field is and it appears blank, yet if I click on it it's got the current date and time. If I hit back and don't even change the date using the calendar control the comes up... it refreshes no problem. Here's where my problem is, how do you refresh the display of this form? here's my entire CreatingEditGroupsEvent method:
private void EditAttributesPage_CreatingEditGroupsEvent(object sender, CreatingEditGroupsEventArgs e)
{
try
{
FeatureDataRow fdr = e.FeatureDataRow;
foreach (DataColumn dc in fdr.FeatureLayer.Columns)
{
// Auto Populate the DATE Field
if (dc.ColumnName.ToLower().IndexOf("date") != -1)
{
fdr[dc.ColumnName] = DateTime.Now;
}
}
if (sender is EditAttributesDialog)
{
// Refresh the Edit Dialog:
EditAttributesDialog editDialog = (EditAttributesDialog)sender;
// Attempt to refresh layout and display auto populated
// None of these worked:
//editDialog.Refresh();
//editDialog.ResumeLayout();
//editDialog.Update();
//editDialog.Show();
//editDialog.Focus();
//editDialog.Activate();
//editDialog.CreateGraphics();
//editDialog.PerformAutoScale();
//editDialog.Hide();
//editDialog.Show();
//MobileApplication.Current.CurrentForm.Refresh();
//editDialog.On
//editDialog.BringToFront();
}
}
catch (Exception ex)
{
ESRI.ArcGIS.Mobile.Client.Dialogs.MessageDialog.Show(ex.Message, "ERROR Edit Attributes", MessageBoxButtons.OK);
}
}
I'm pretty frustrated with it since it actually does work, but from a user's perspective they won't think it's working if I start auto populating other fields automatically through code.Anyone have any ideas? Anyone ever come across this or something similar?