# pidog Dataview on demand 

**URL:** <https://forum.xojo.com/t/pidog-dataview-on-demand/48582>\
**Category:** Extras\
**Created:** [May 17, 2019, 7:08pm UTC](https://forum.xojo.com/t/pidog-dataview-on-demand/48582 "2019-05-17T19:08:24Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guenter\_Kraemer](https://forum.xojo.com/letter_avatar_proxy/v4/letter/g/35a633/32.png) [@Guenter\_Kraemer](https://forum.xojo.com/u/Guenter_Kraemer)\
**Post date:** [May 17, 2019, 7:08pm UTC](https://forum.xojo.com/t/pidog-dataview-on-demand/48582/1 "2019-05-17T19:08:24Z")

</div>

I have a dataview grid loaded with data on demand, on Windows 10.  
The grid get the data from an array.  
I want to change some data in the grid, how do I refresh the grid properly?  
I changed the value in the arrayx, and called various functions like Redraw, Refresh, InvalidateRow etc., but all end up with the same result, the text is not displayed properly anymore as seen in the picture below.  
What am I doing wrong?

![](http://scraperfiles.com/1.jpg)

---

<div class="post-metadata">

**Author:** ![jim\_mckay](https://forum.xojo.com/user_avatar/forum.xojo.com/jim_mckay/32/905_2.png) [@jim\_mckay](https://forum.xojo.com/u/jim_mckay)\
**Post date:** [May 17, 2019, 7:48pm UTC](https://forum.xojo.com/t/pidog-dataview-on-demand/48582/2 "2019-05-17T19:48:02Z")

</div>

How are you adding the data? There are several approaches you could take. Are you using the RowWillRender event to copy the data? or using a DataSource subclass to use the array as storage.

---

<div class="post-metadata">

**Author:** ![Guenter\_Kraemer](https://forum.xojo.com/letter_avatar_proxy/v4/letter/g/35a633/32.png) [@Guenter\_Kraemer](https://forum.xojo.com/u/Guenter_Kraemer)\
**Post date:** [May 17, 2019, 8:21pm UTC](https://forum.xojo.com/t/pidog-dataview-on-demand/48582/3 "2019-05-17T20:21:14Z")

</div>

I am using the RowWillRender event.

---

<div class="post-metadata">

**Author:** ![jim\_mckay](https://forum.xojo.com/user_avatar/forum.xojo.com/jim_mckay/32/905_2.png) [@jim\_mckay](https://forum.xojo.com/u/jim_mckay)\
**Post date:** [May 17, 2019, 8:56pm UTC](https://forum.xojo.com/t/pidog-dataview-on-demand/48582/4 "2019-05-17T20:56:52Z")

</div>

I’ll assume you’re following from the demo project.  
If you’re doing something like this:

```auto
me.cell(index,0)=arrayx(index)
```

Be sure to check that you’re assigning a new value to the cell. Something like:

```auto
if me.cellValue(index,0)<>arrayx(index) then me.cell(index,0)=arrayx(index)
```

The reason for this is an issue I discovered where you could end up with an infinite refresh loop. I’ve added code to avoid the issue in the next update.

The RowWillRender event should be called after InvalidateRow when the view is ready to display the row. If it is not firing then there may be something else going on.

---

<div class="post-metadata">

**Author:** ![Guenter\_Kraemer](https://forum.xojo.com/letter_avatar_proxy/v4/letter/g/35a633/32.png) [@Guenter\_Kraemer](https://forum.xojo.com/u/Guenter_Kraemer)\
**Post date:** [May 17, 2019, 9:22pm UTC](https://forum.xojo.com/t/pidog-dataview-on-demand/48582/5 "2019-05-17T21:22:01Z")

</div>

The RowWillRender event ist firing fine when I call Redraw() or Refresh() etc., just the font is bad, as seen in my picture. Something is not 100% refreshed, because when I move the Window via mouse outside the Desktop and back, it refresh properly.

I have to use the RowWillRender on demand thing, because I have array with sometime 5mio. or 10mio. urls in it. I cant set them directly in the grid.

---

<div class="post-metadata">

**Author:** ![jim\_mckay](https://forum.xojo.com/user_avatar/forum.xojo.com/jim_mckay/32/905_2.png) [@jim\_mckay](https://forum.xojo.com/u/jim_mckay)\
**Post date:** [May 17, 2019, 9:27pm UTC](https://forum.xojo.com/t/pidog-dataview-on-demand/48582/6 "2019-05-17T21:27:32Z")

</div>

Ok, I see. What scale factor is your system using?

---

<div class="post-metadata">

**Author:** ![Guenter\_Kraemer](https://forum.xojo.com/letter_avatar_proxy/v4/letter/g/35a633/32.png) [@Guenter\_Kraemer](https://forum.xojo.com/u/Guenter_Kraemer)\
**Post date:** [May 17, 2019, 9:37pm UTC](https://forum.xojo.com/t/pidog-dataview-on-demand/48582/7 "2019-05-17T21:37:10Z")

</div>

Because its a 4k monitor, I set Windows to 175%  
Strange is, when I load the array and set the grid rows to the number of array entries, all entries are correct displayed the first time, but modifying rows will lead to this strange font issue after that.  
For example, I load 10 urls into the array, and all are correct displayed after I set the linecount to 10 what triggers the RowWillRender event. After that, when I modify for example the text in the 3rd. row and call Redraw, or Refresh, or set linecount, the font is bad.

---

<div class="post-metadata">

**Author:** ![Guenter\_Kraemer](https://forum.xojo.com/letter_avatar_proxy/v4/letter/g/35a633/32.png) [@Guenter\_Kraemer](https://forum.xojo.com/u/Guenter_Kraemer)\
**Post date:** [May 28, 2019, 5:17pm UTC](https://forum.xojo.com/t/pidog-dataview-on-demand/48582/8 "2019-05-28T17:17:40Z")

</div>

I noticed that this issue vanish when I turn HighDPi off (but then all is blurry)

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [April 29, 2021, 3:56pm UTC](https://forum.xojo.com/t/pidog-dataview-on-demand/48582/9 "2021-04-29T15:56:34Z")

</div>


