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
585
AfterRowLayoutItemResized
posted

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:

 

 

 

 

 

void myGrid_AfterRowLayoutItemResized(object sender, AfterRowLayoutItemResizedEventArgs e)
{

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

 

 

  • 4555
    Suggested Answer
    posted

    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

  • 4555
    posted

    Hi Steve,

    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();
            }

     

    Magued