Hi, I’m using UltraTimeView Control, user can resize the column width.I want to get the value of ColumnWidthResolved property, when the column width has been changed.Actually I’m using PropertyChanged event of UltraTimelineView control.However, the PropertyChanged event has been called too much, and I don’t need most of them.I need only specified case when the value of the column width has been changed by any reason (user operation or by program code).Please tell me the best practice.
Hello Keiji,
Thank you for contacting Infragistics!
You will want to handle the ColumnResizing and/or ColumnResized events. They are on the IUIActionNotifier interface and can be handled as follows:
private void Form1_Load(object sender, EventArgs e) { var uIActionNotifier = (Infragistics.Win.UltraWinSchedule.TimelineView.UIActionNotification.IUIActionNotifier)this.ultraTimelineView1; uIActionNotifier.ColumnResizing += UIActionNotifier_ColumnResizing; uIActionNotifier.ColumnResized += UIActionNotifier_ColumnResized; } private void UIActionNotifier_ColumnResizing(Infragistics.Win.UltraWinSchedule.UltraScheduleControlBase control, Infragistics.Win.UltraWinSchedule.TimelineView.UIActionNotification.ColumnResizingEventArgs args) { } private void UIActionNotifier_ColumnResized(Infragistics.Win.UltraWinSchedule.UltraScheduleControlBase control, Infragistics.Win.UltraWinSchedule.TimelineView.UIActionNotification.ColumnResizedEventArgs args) { }
Dear Mike
Thank you for answering my question.I try to use the sample, and when user changes the width of column, it works fine, thanks.But, I also put the value of ColumnWidth by my program code (like bellow), and in this case I couldn't catch the event.
private void Form1_Load(object sender, EventArgs e) { var uIActionNotifier = (Infragistics.Win.UltraWinSchedule.TimelineView.UIActionNotification.IUIActionNotifier)this.ultraTimelineView1; uIActionNotifier.ColumnResized += UIActionNotifier_ColumnResized; this.ultraTimelineView1.ColumnWidth = 18 } private void UIActionNotifier_ColumnResized(Infragistics.Win.UltraWinSchedule.UltraScheduleControlBase control, Infragistics.Win.UltraWinSchedule.TimelineView.UIActionNotification.ColumnResizedEventArgs args) { }
Why I couldn't catch the event, because I have some luck of UltraTimelineView control setting?Would you give me any advice?Thanks
Hi,
The UIActionNotifier interface is to notify you about UI Actions. So the events fire when you resize the column width via drag and drop. But it doesn't fire when you set the ColumnWidth in code. If you set the ColumnWidth in code, you know you did it, and you don't really need an event to tell you that it happened. :)