Binding Query Result To FeatureDataGrid

3290
12
07-26-2011 01:24 AM
ManojrajTeli
Occasional Contributor II
I am trying to bind the query result returned from by query to the FeatureDataGrid but instead of attributes the geometry of the result is getting bound to Feature datagrid.Please suggest the code to bind attributes to FeatureDataGrid.Thank you in advance.
0 Kudos
12 Replies
PhilipKnight1
Occasional Contributor

void queryTask_ExecuteCompleted(object sender, QueryEventArgs e)
{
attribWidget.featureDataGrid1.Map = this.MapControl;
attribWidget.featureDataGrid1.ItemsSource = e.FeatureSet.Features;
}


But I have no success neither with DataGrid nor FeatureDataGrid 

ps: I don't want to make any previous selection on the map, so I don't need a graphic layer. I just want to display attributes on FeatureDataGrid


Did you add a breakpoint in queryTask_ExecuteCompleted? is e.FeatureSet.Features returning results? If it's not returning anything then there's your problem. But if it is returning some features the problem might have to do with how the FeatureDataGrid is set up. For isntance, if you have AutoGenerateColumns=FALSE, then it might be unable to create the needed collumns and therefore not create any rows (just a guess).

Also, A bit of advice: If it is just not working at all remove/change pieces of the example slowly and test after each one until it breaks so that way you can figure out where it's breaking and what you are doing to break it. Good luck!
0 Kudos
EzequiasRodrigues_da_Rocha
New Contributor III
I got the solution on this thread.

http://forums.esri.com/Thread.asp?c=93&f=2455&t=283850&g=1#top

Sincerely
Ezequias Rocha
0 Kudos
ELIZABETHF_T_
New Contributor III
hi Ezequias, you were able to run the code inside VS2010 Silverlight.
0 Kudos