Hi,
I have UI which is having two ultra grids placed like top and bottom. Both grids are Cardview setup and if user resize the column width of the top grid i have to resize the bottom grid column width as well so that the UI looks consistence.
For the above scenario i'm trying to capture the column resize event "AfterColPosChanged" but it's not getting triggered when the grids are in cardview but in the default view it's triggered.
Please help me on subscribing the appropriate event for column resize event in cardview or an approach to achieve it.
Regards,
Sundaram
Hello ,Mee
Thank you for Posting. In the grid cardview mode when you are talking about resizing the column width I am sure you are talking about adjusting the Width of the card?
You can't actually resize the columns in CardView, because the columns are displayed as rows, and AfterColPosChanged event is specific to the grid column repositioning/resizing .
Looking into API I didn't find any specific event fire when we change the card width but you can workaround by using PropertyChanged event .Something like this:
private void UltraGrid1_PropertyChanged(object sender, Infragistics.Win.PropertyChangedEventArgs e) { var trigger = e.ChangeInfo.FindPropId(Infragistics.Win.UltraWinGrid.PropertyIds.Width); if (null != trigger && trigger.Source is UltraGridCardSettings) { Debug.WriteLine("Card Width Changed!"); } }
The downside of that approach is that this event fires any time any property in the grid changes for any reason, So it might slow down the app and cause slow performance but again there is no specific event to handle this.
Let me know if you have any question.
Regards,Divya Jain
Hi Divya Jain,
Thank you for your quick response.
Yes, I mentioned about adjusting Width of the card.
I did further investigation like creating a simple sample application as per my requirement and subscribed all the events.
When i change the width of the card no events are fired except the one which you suggested (PropertyChanged).
As you mentioned it's is fired for any property changes on the grid.
So i thought to use an other approach to subscribe the "SubObjectPropChanged" event for the CardSettings class
like below. i think this will improve in performance. Please let me know your input on this approach.
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { foreach (var column in e.Layout.Bands[0].Columns) { column.Band.CardSettings.SubObjectPropChanged += column_SubObjectPropChanged; } } void column_SubObjectPropChanged(Infragistics.Shared.PropChangeInfo propChange) { var trigger = propChange.FindPropId(Infragistics.Win.UltraWinGrid.PropertyIds.LabelWidth); if (trigger != null) { //Do the action for the CardSettings width changes. } }