尚未解决:
原文地址:http://blog.163.com/zwx_gis/blog/static/3243443520113201425184/
前台:
<ComboBox Name="comboBoxQuxian" SelectedValue="{Binding Path=QuXianData, Mode=TwoWay}"
SelectedValuePath="QXH" DisplayMemberPath="QXM"
Height="23" HorizontalAlignment="Left" Margin="51,47,0,0" VerticalAlignment="Top" Width="136">
</ComboBox>
后台:(quxianFs为ArcGIS的QueryTask查询返回的Featureset)
List<QuXianData> quXianDataList = new List<QuXianData>();
foreach (Graphic featureTemp in quxianFs)
{
quXianDataList.Add(new QuXianData()
{
QXH = featureTemp.Attributes["QXH"].ToString(),
QXM = featureTemp.Attributes["QXM"].ToString(),
});
}
comboBoxQuxian.ItemsSource = quXianDataList;
comboBoxQuxian.SelectedValuePath="QXH";
comboBoxQuxian.DisplayMemberPath="QXM";
public class QuXianData
{
public string QXH { get; set; }
public string QXM { get; set; }
}
注:前台和后台的红色部分任选其一