Good morning everyone.
I have three columns in a XamDataGrid "IDSoggetto", "Name" Surname ". I need to know the value of IDSogetto when I click on a cell. For example, if I click on the "Name" I want to know about the IDSoggetto. with the code: object MyValue = xamDataGrid.ActiveCell.Value the cell value I have selected but I need the value of its staff to the field IDSoggetto.
Sorry for not correct English.
Thank you.
Hello Sabrina,
Thank you for your post. I have been looking through it and I suggest you use this code:
var isFilterRecord = (xamDataGrid1.ActiveCell.Record is FilterRecord);
to check if a Cell’s Record is FilterRecord and this code:
var cellValue = xamDataGrid1.ActiveCell.Record.Cells["IDSoggetto"].Value;
to get a Cell’s Value. Please let me know if this helps you or you need further clarifications on this matter.
Looking forward for your reply.
Sorry to jump in but Stefano is not reachable for connection problems and as you can understand he uses the google translator because he is not so fluen in its english. I hope to be a little better :Dfrom what he told me and what he wrote translated from italish the problem is the following:- He needs to know if a cell is on the filter row or on a data row, in windows forms we used the cell.row.Isdatarow or cell.row.isfilterrow properties.- He also needs to acces the IDSoggetto cell to get its value when he is on the Name cell. Something that in winforms was done using cell.row.cells["IDSoggetto"].Value, I don't use yet WPF so I don't know the equivalence.If you can answer you surely made him a happy programmer.Thank You in advance
I solved the problem with this code:
if(this.xdgBase.ActiveCell != null ){mIDSoggettoTmp = (int)(xdgBase.ActiveRecord as DataRecord).Cells["IDSoggetto"].Value;
now if I click on the cell filter gives me error. how do I trap the cell filter and I'm not on a given?
Thank you for the perfect answer. I solved my problem.Thanks again