hello
I 'm trying to handle resized column event when the user
resize it to save its new width on setting file
how can i do that I didn't find any event in XamDataGrid that respond to resize event
As an edit to the above (my "More" seems to not work), Field.PropertyChanged needs to be handled, not Field.Settings.PropertyChanged
Paul
Is there any update to this? Does the lastest version have a field resized event to capture?
Regardless of the above (as we do not yet use it) the mention ofPropertyChanged does not work - the event does not fire.
Alex - you have mentioned using an editor style - this would mean having to handle this for all editor types if the dataset is not fixed in it's content, yes? Seems quite a convoluted solution, just to capture a column resize. Is there no simple way to do this?
Many thanks
Paul Eden
I think you can achieve this by grabbing the PropertyChanged event of Field Setting. The property name we care would be LabelWidthResolved and CellWidthResolved.
Yes, in style you should use <EventSetter .. Handler= ... Event=.../>
Regarding the EventManager, it basically is the same thing as the EventSetter but without the style. If you want, you can create a style and hook up the SizeChanged event to that style. The other option is by EventManager:
EventManager.RegisterClassHandler(typeof(ValueEditor), ValueEditor.SizeChangedEvent, new SizeChangedEventHandler(e_SizeChanged));
The first parameter is what type you want to register an event to.
The second parameter is the actual event (as in the EventSetter)
Thrid parameter is the handler.
With EventSetter, this code would look like:
<Style TargetType="{x:Type igEditors: XamNumericEditor}">
<EventSetter Event="SizeChanged" Handler="e_SizeChanged"/>
</Style>
Let me know if you have questions on this.
Alex.
thanks I found answer for my second problem
it is so easy :
To match event handler to Style by Code or By xaml
just use Event Setter
okay I 'm waiting for you code ?
thanks again Alex