They let me make a little c# program with devexpress in programming class. The teacher gave us an explanation and how to use search, but his form was only one, mine currently has 3. When I try to adapt the teacher's explanation, I get an error in this line:
Paciente pac = (Paciente)searchLookUpEdit1View.GetFocusedDataRow();
Which belongs to:
private void searchLookUpEdit1_EditValueChanged(object sender, EventArgs e)
{
Paciente pac = (Paciente)searchLookUpEdit1View.GetFocusedDataRow();
var criterion = new GroupOperator() { OperatorType = GroupOperatorType.And };
criterion.Operands.Add(
new BinaryOperator("Paciente.Paciente", pac.Num_seguro, BinaryOperatorType.Equal));
xpSignosV.Criteria = criterion;
}
I was looking for a while and I noticed that I had the Data Source, Display Member and the Value Member well since in other questions to the forum they mentioned that the error could come from there
Could someone enlighten me? please
The drawback is that the GetFocusedDataRow() method returns a value of type DataRow, and this cannot be converted to type Patient explicitly, so you must map the properties for this to work correctly. you could do this: