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
920
Capture field widths on resize
posted

Hi

I need to capture the column widths and store them so that when I open the application the next time, I can restore the same column widths. How can I capture the column width when resized? Is there an event?

Thanks,

Lala

Parents
  • 34810
    Offline posted

    Hello Lala,

    There currently does not exist an exclusive "FieldWidthChanged" type of event in the XamDataGrid's public API, but each Field in the XamDataGrid does expose a PropertyChanged event that will fire when that particular Field resizes. Depending on how the user resizes the field will determine which property this particular event fires for. For example, this PropertyChanged event's arguments contains a PropertyName property (e.PropertyName). If the user resizes the Field by resizing the Header, this event will fire for the "LabelWidthResolved" property. If the user resizes the Field by resizing one of the cells that belong to that Field, this event will fire for the "CellWidthResolved" property.

    I would recommend that you handle this PropertyChanged event for your Fields and make an if check for e.PropertyName.Contains("LabelWidth") || e.PropertyName.Contains("CellWidth"), as this will allow you to essentially catch when a Field has resized in the XamDataGrid.

    If you would like to see a FieldResized event officially included as part of the XamDataGrid in a future version, I would recommend suggesting a new product idea for this feature at http://ideas.infragistics.com. This product ideas site will place you in direct communication with our product management teams who plan and prioritize upcoming features and development based on community and user feedback.

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer

Reply Children