I m listening/subscribing to the event "FieldLayoutInitialized" and running a loop on all fields.
How can get the LabelPresenter instance from the field instance?
Hello,
The LabelPresenter is not initialized yet in the FieldLayoutInitialized event. It is best to handle the Loaded event of the XamDataGrid. Then iterate through the cells of any record and from there get the LabelPresenter.
To do this, you can use our helper methods GetAncestorFromName(...) | GetAncestorFromType(...).
To use there methods, you have to give as a parameter a Dependency object from which to go up the element tree. In your case, it's best that to be the CellValuePresenter of the current cell.
Please let me know if you have any questions on this.
I've got the same situation as a Gajender. I need to get a list of LabelPresenters. Iterating through cells is not suitable because there could be no rows in the grid. Is there other method to do that?