Select to view content in your preferred language

Applying Feature Data Form attributes to multiple new features/records

440
0
01-07-2014 07:41 AM
GISProgrammer
New Contributor III
I added a button to the Feature Data Form. All that this button does it Adds a new record (feature) in a related feature table.

I have the several features selected and their attributes are displayed in a FeatureDataGrid.

I add a button in the FeatureDataGrid that opens the feature Data Form and then when the hit the (AddAllRecordButton) it adds a new record in the related table. I have a one to one WorkORder related table system going and I???m trying to create a way my endusers can selected many features and create a workorder for each feature.

So this code basically creates a record in the related feature class for each selected graphic in my Feature Data Grid.

The problem I???m running into is if the user fills out any information it is not writing those attributes to the newly created records.

Long story short I was hoping you could give me some insight on how to apply the changes to all new records created. I was wondering if there was a way to grab the information that was typed into the feature data form textboxes. The problem I have is I don???t know what they are called because the feature data form is binded and created on fly (MyFeatureDataForm.FeatureLayer = l)

I Keep thing something simple like, but I don???t know if the input boxes on the Feature Data Form have names and if so what they are named.


g.Attributes["COMMENTS"] = MyFeatureDataForm.CommentsTextBox.Text;




The feature data form has new information that the enduser supplied and I need to apply this to all the records I just created.

If I can???t grab the information and physically ApplyChanges() -- because I know the ObjectIDs/RelatedID that werer created in the related feature class/table. I was wondering right after I add the new graphic, I could select it and then applychanges, which is what I going for below.


private void AddAllRecordButton_Click(object sender, RoutedEventArgs e)
{
foreach (Graphic qg in QueryDetailsDataGrid.GraphicsLayer)
{
var g = new Graphic();


g.Attributes["CleanID"] = Convert.ToInt32(qg.Attributes["OBJECTID"]);

MyFeatureDataForm.ApplyChanges();


l.Graphics.Add(g);

MyFeatureDataForm.ApplyChanges();

}

l.SaveEdits();

}



Seems like this board is slowing dying but I'm hoping there is someone out there that will/can help.

Thanks
0 Kudos
0 Replies