I have a Windows Form app with an ultragrid. I'm trying to capture the event when a column is resized in my Grid. I establish the event handler as:
myGrid.AfterRowLayoutItemResized +=
new AfterRowLayoutItemResizedEventHandler(myGrid_AfterRowLayoutItemResized);
I then defined an method as:
My code...
}
However, when I run the app and resize a column, the method is not called. Am I missing something? Is there some reason that this event wouldn't fire?
Thanks,
Steve Weeks
Hi Steve,
If you are not using Row Layout for your column arrangement, then there are two events that you can use: the BeforeColPosChanged and the AfterColPosChanged events.
Magued
First you have to make sure that the grid is using the Row Layout using the column arrangement method. Second using the designer you can create the event by double clicking on it. Or through the code as you did. The following code snippet will fire the event when you resize the column. I have added it in the Form constructor:
this.ultraGrid1.AfterRowLayoutItemResized += new Infragistics.Win.UltraWinGrid.AfterRowLayoutItemResizedEventHandler(ultraGrid1_AfterRowLayoutItemResized);
The event that was created by default looks as follows:
void ultraGrid1_AfterRowLayoutItemResized(object sender, Infragistics.Win.UltraWinGrid.AfterRowLayoutItemResizedEventArgs e) { throw new NotImplementedException(); }