我尝试将itemsource设置为等于datagrid项源,因为我 只想显示一次“un”属性。我还在组合框的xaml中设置了绑定属性,并返回类引用。在调试它时,它正确设置了显示成员路径,但在运行它时它不会显示在组合框中。
private void dgViewCBIData_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
cbi= (CBICalculate)dgViewCBIData.SelectedItem;
txtName.Text = cbi.Name.ToString();
txtHeight.Text = cbi.He.ToString();
txtWeight.Text = cbi.We.ToString();
cmbUnits.DisplayMemberPath = cbi.Un;
}
答案 0 :(得分:0)
By filter =By.xpath("MYLOCATOR");
System.out.println("About to click on result");
Point point = ad.findElement(filter).getLocation();
int elementCenterX = point.getX() + 80;
int elementCenterY = point.getY() + 100;
System.out.println("value of x = "+elementCenterX+" value of y = "+elementCenterY);
ad.tap(2, elementCenterX , elementCenterY , 0);
属性应设置为DisplayMemberPath
,用于标识要在string
中显示的属性的名称。
因此,如果您有一个名为ComboBox
的属性并希望显示此属性的值,则应将Un
设置为DisplayMemberPath
" Un":
string