Page 1 of 1

Created JiwaGrid Column Width Issue

PostPosted: Thu Sep 14, 2023 12:58 pm
by neil.interactit
Hi guys,

I am stuck on something that is probably easily fixed but is eluding me.

I am creating a new JiwaGrid which is placed on 2 forms - Purchasing / Order Entry and Purchasing / Landed Cost / Shipments.

The same grid works fine on the Order Entry form but not on the Shipments form ... the columns are all roughly half the correct width.

I have attached a cut down sample.

Could you point out the error of my ways?

Cheers,
Neil

Re: Created JiwaGrid Column Width Issue

PostPosted: Thu Sep 14, 2023 6:33 pm
by SBarnes
Hi Neil,

Whilst I can't tell you how to fix the problem I can tell you what is causing the problem, if you undock the shipment form and then close it an open it without it being maximized you will see that the columns do in fact fill what the grid is initially given in terms of width, so the issue I believe relates to the fact that the grid is sitting in the Table Layout control and for some reason is not refreshing on the form resize.

This image demonstrates what I mean.
shipment.jpg


Mike or Scott may be able to offer a way to overcome the issue.

Re: Created JiwaGrid Column Width Issue  Topic is solved

PostPosted: Fri Sep 15, 2023 11:51 am
by Mike.Sheen
If you ever create a JiwaGrid control and add it to a form, you need to invoke the InitialiseGridControl() method or a bunch of things won't work right - including resizing.

Why it resized the grid columns on the PO form and not the LandedCost form is probably related to the order things occur in each of those forms - but just invoking InitialiseGridControl() will make it work everywhere.

You may have also noticed that you also didn't get a context menu appear when you right-clicked the column header of the grid on either form - that's another thing which InitialiseGridControl() does - it adds all the event handlers to handle interactions and stuff for you.

Attached is a revised version of your plugin, calling the InitialiseGridControl() method.

Re: Created JiwaGrid Column Width Issue

PostPosted: Fri Sep 15, 2023 1:01 pm
by neil.interactit
Ah, perfect, thanks Mike.

I hadn't specifically noticed the lack of the context menu, but I had wired up a few drill downs which weren't working and was about to look into that.

Thanks again,
Neil.