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
80
UltraWinGrid Band 2 Column Width
posted

Hi Support

I have an application in which I am using UltraWinGrid (infragistics 14.2).

In my grid I have two bands (have two table with relation as data source of grid).

First table (you can say first band) has “Comments” as Last column and second table has “Delete” as Last column.

My requirements are:-

  1. Last column of band 1 (that is Comments) should extended.
  2. Last column of band 2 (that is Delete) should not extended.
  3. Width of second last column of band 2 (that is Comments ) should be equal to width of last column of band 2(that is Comments and changed at run time with respect of description column)

 

Here I am attaching a demo application for the same, please view what I have did and please suggest the solution.

 

Thanks in advance.

UltraGridDemo.zip
Parents
  • 469350
    Verified Answer
    Offline posted

    Hi Umesh,

    The reason your code isn't working is that the size of the Band 0 comments column has not yet been updated in Form_Load. The ExtendLastColumn adjustment doesn't occur until the first time the grid paints.

    In any case, since you want the columns to stay in synch, it's probably best to just set the column width inside the grid's Paint event. This is a bit heavy-handed and could potentially cause a performance issue, but I think it should be okay.

    I am attaching a modified version of your sample here where I hook the Paint event of the grid and set the width there.

    The only other thing I changed was to set the Width on the Delete column to 20. You were setting MinWidth and MaxWidth, but you need to set Width, also. The Min and Max only affect user resizing or autosizing so that wasn't doing anything.

    Also, it's not important, but I could not run our sample initially because the delete.png file was missing. I just replaced it with an image of my own. But I thought I'd mention it in case you wondered why your delete image changed.

    UltraGridDemo.zip
Reply Children
No Data