Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
3806
how to get the LabelPresenter from the Field
posted

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?

Parents
  • 69686
    Suggested Answer
    posted

    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.

Reply Children
No Data