Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IWGrid is driving me insane.....
#1
Hi Guys,

I have an IWGrid on my form, below 2 regions, and above one region. None of the regions are aligned to top or bottom. Just placed and anchered to stay when resizing.

The IWGrid has properties: Top=246 and Height =563. It's anchered Left and Top. UseSize and UseFrame are true. I set Rowcount = 2.

I then select a number of records from a table with sql and set rowcount = sql.recordcount +1; Then loop from first to eof, adding the selected fields;

Even with more rows that can fit into the visible space of the grid, it look nice. And with a scrollbar on the right. perfect. I have added Clickable to each rows cell[0].

While the form is visible, through an IWEdit field, I change SQL statement and generalt a new SQL call, limiting the records for each keypress. With less SQL Rows than can fit into the gridframe, grid cell hight becomes higher, adjusting to the total height of the grid. With only one row found, the heading row, and the data row, fills the entire space, being way to high.

BUT... Already at the second keypress, regardless of which key is pressed, the grid moves down so that the top is in the middle of the screen, and regardless of what I do, it won't go back to the designed place. With Logging on, I can see top is still = 246, event  though it is more like 406.

I know there is way more properties per cell, than what is editable through the grid, and I'm sure some of them are responsible for part of the abnormal behavior, but I don't know and I'm just guessing as I have no description of properties for the grid or it's cells....

Do anyone have any idea of what is going on and how I can prevent my grid from changing size and moving around, please let me know. Also, should anyone have any description of cell.properties, please point me to them.

NB! I'm running under IE11 when testing as a stand alone. however, it is the same issues under Edge and Chrome.

Regards
Soren
Reply
#2
I have included 3 images to show the result and hope a visualization helps.

First image show the full content of the table. (SQL call without Where clause)
Second image show only those rows with an S in them (note the S in the IWEdit above) after a new SQL call with Where LokationNavn like '%s%'
Third image show the lot less rows with SV in them. (SQL call with where LokationNavn like '%sv%')

Changes are done in the Keypress method of IWEdit1 and the grid is shown with all SQL rows satisfying the selection. For each SQL call, I do reset Grid TOP, HEIGHT and ROWCOUNT to designed values, as well as do a IWGrid1.clear to empty all cells.

And there are two issues:
Why do the Grid change the height of the cells, when there are less rows than what would fill the size of the grid, if rows had normal height ?
Why do the Grid change it's position ? The value of top is still the same but obviously and visually it has moved.


Attached Files Thumbnail(s)
           
Reply
#3
Hi Soren,

Can you copy and paste the content of your DFM regarding your grid, so I can see how you you set up its properties?

I'd guess from the image that:
1- Is happening because the grid is trying to adjust the row height so it would keep the same total height and width
2- When anchored, position is recalculated on demand to satisfy the constraints (i.e. size of the grid vs size of the page). Something obviously is not as expected, as the result is not satisfactory.

You can try to remove bottom and right anchors (if set) and see if it fixes the issue.
Reply
#4
Interesting that I've got a IWDBGrid on one of my forms. I have only top/left anchors set.

I've recently found that if I reduce the number of rows it will dramatically increase the rowheight as well. But, if I start it with one row the height is correct.

Also find that changing the number of rows (change dataset query, in async event) so that:
Initially too many for the grid, sets a scrollbar as expected.
Then, Change dataset query to reduce the rowcount to 2 or 3 rows, rowheight increases (apparently fills the grid region).
Then, Increase rowcount to approximately the region size, rowheight reduces again to normal size.
Then, Increase rowcount to many more, the grid overflows the region and continues on the page well beyond the footer (footer is in template).

I haven't changed this in a very long time so haven't looked at anything cute I might have done in the code but I don't recall this behavior when I was working on it. It's not a scenario I routinely run into so not sure about behavior change, but was easy for me to try and simulate the situation above.

Now running 15.1.2 in XE2.

I'm not sure this is related to the issue above but let me know if you need anything from me. I will update to 15.1.3 when I get a chance.

Dan
Reply
#5
Hi Alexandre,

I have tried almost everything possible to adjust, without much luck. Among those, also the anchors. But after I placed the Grid on (or inside) a region, it is not as bad as before. I still experience much of what Dan describes, but at least the grid stays in place, and is no longer moving around. As with Dan, before it was often with a great deal below the bottom of the form. But with the region, that has changed. All I experience now is the uncontrollable grow in row hieght with less and less rows in the grid. With only 2 rows, one header and one data, they each occupy half of the region/grid size.

However, I have noticed that if I press ENTER, while the focus is in the input field above the grid (the field where the OnChange event causes the grid to be redrawn based on a new SQL string for each keypress), the grid is again redrawn, but without a new SQl call, it apparently causes the grid to render with normal sizes. Strange.

Anyway, I have added 4 files to the post:
Gridpart-dfm.txt is the copy you asked for.
RegionGridpart-dfm.txt is the same, but with the region part as well.
And GridUnit.txt is the code behind the grid, being executed for each keypress with an adjusted SQL select.

I have also added Gridpartwithoutregion-dfm.txt which is what it looked like when I wrote my first post in this tread.


Attached Files
.txt   Gridpart-dfm.txt (Size: 871 bytes / Downloads: 6)
.txt   RegionGridpart-dfm.txt (Size: 1.17 KB / Downloads: 6)
.txt   Grid1Unit.txt (Size: 1.94 KB / Downloads: 10)
.txt   Gridpartwithoutregion-dfm.txt (Size: 718 bytes / Downloads: 6)
Reply
#6
If it helps, I pulled an old exe out of SVN and it behaves as expected (does NOT increase rowheight).

That exe was built with iw 14.1.5. Increasing and decreasing row count just changes whether there is a scrollbar. The grid stays within the region I put it in. As expected.

[edit] I also found a build with 14.2.2 which is also OK.

Dan
Reply
#7
Hi Soren,

there is a new release candidate which you can try already while we are finishing up our tests.

http://downloads.atozed.com/IntraWeb/IW15.1.5_RC2.exe

it will fix the grid issue. This will probably be released officially in a couple of days.
Reply
#8
Alex,

I downloaded 15.1.5RC3 and it fixes several issues but breaks bootstrap 4 apps that show regions from async events (# of the controls / pages render).

I am going to investigate a little further but...

Any ideas?

Shane

Howdy Again Alex!

The problem is that the Visible property if initially False and then set to True in an Async event, it isn't reflected to the control on the page (it still shows with the hidden attribute in FireBug). If I remove the visibility:hidden with firebug, the page renders.

Hope this helps,

Shane

Howdy Alex Again!

And what ever changed from 15.1.early # now to 15.1.5 is also now causing my application to crash again....

Well, back to 15.0.24.

Shane
Reply
#9
The visible issue has been fixed in our code base and will be released soon.

However, I believe that "my application crashed" is not enough information to allow me to investigate it further.

I need *at least* a full stack trace in case you are having an unexpected exception. Better would be a test case, although I understand that sometimes it is not easy to provide one. But the stack trace can be obtained out of the box, no need for anything else....
Reply
#10
Hi Alexandre,

After a long awaited, and well deserved holiday, I've finally installed and tested the ..15_RC2.exe update. It does solve the visual problem and the grid now look like I want it to, regardless of how many lines it consist of. Problem solved.


Thanks for the update.

regards
Soren
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)