Jump to content
mje

Virtual Multicolumn Listbox

Recommended Posts

Looks good to me...before looking at your VI, I envisioned solving the issue just like you did...only format the visible cells. Seems like a simple enough approach that you could add a horizontal scrollbar as well with minimal effort.

Share this post


Link to post
Share on other sites
...the UI bogs down for minutes at that point, even with UI updates being deferred etc.

Even with UI updates being deferred? I can't decide if that's possibly a bug or should be changed via a feature request...

Share this post


Link to post
Share on other sites

Even with UI updates being deferred? I can't decide if that's possibly a bug or should be changed via a feature request...

Indeed, even with the UI updates deferred. Granted these are user reports, so minutes might need to be taken with a generous dose of salt, I've not been able to try these data sets out.

Part of the problem was my fault since I never bounded the size of the data set: the application was designed around small data sets where blindly updating everything was OK. There were far more important things on the priority list than eeking out a few extra ms of performance from a UI update. Move from a few hundred to a few hundred thousand rows though and things are a different story.

These controls (trees, mclb) seem to be implemented such that once you've applied formatting to cells, the control remembers that formatting data for every cell regardless of whether that cell has data in it. I'm not arguing this shouldn't be the case, but it becomes troublesome since there seems to be no means to clear the formatting data.

Once you've applied formatting to a large number of cells, operating on that data set becomes slow. Combine that with the fact that applying each facet of formatting requires an individual operation for each cell and the number of operations required can quickly multiply. Want to set font color, style, and justification? That's four operations per cell: cell selection, apply color, apply style, apply justification. If your format cache is big, each of those operations can be slower than if the cache is small, and if you're blindly applying those instructions on a 100000x8 data set, you better have some time on your hands.

Of course I'm not implying anyone should ever do that many operations on any of these controls, again this problem arose from using the program for something outside of it's original design. The right thing to do in this case is a virtual solution like I posted above.

Share this post


Link to post
Share on other sites
These controls (trees, mlcb) seem to be implemented such that once you've applied formatting to cells, the control remembers that formatting data for every cell regardless of whether that cell has data in it. I'm not arguing this shouldn't be the case, but it becomes troublesome since there seems to be no means to clear the formatting data.

Also true - I have a job I just delvered where I color cells based on OK/Suspect data - then, when new measurements come in, I can't assume the dataset is the same size, so I have to color an arbitrary number of cells white first, then color the OK/Suspect cells - I agree that there needs to be a method to clear formatting.

Share this post


Link to post
Share on other sites
You could use the following code to set all cells of mclb to the same format.

Ugh - I'd totally forgotten about that! Thanks Olivier :)

Share this post


Link to post
Share on other sites

You could use the following code to set all cells of mclb to the same format.

post-853-0-56691200-1324396823.png

This not a "clear formatting" method, but it works and it's efficient.

Regards,

Olivier

I've also used this and its other variants (for selecting all columns in a row etc.). It works pretty well.

Now we need a way to select all alternate (even/odd) rows/columns. That'll help when you are trying to color alternate rows/columns for ease of following a large table across/down.

Share this post


Link to post
Share on other sites

Hi Phillip,

This is how I've been alternate coloring the rows too. I wish there were a way to select all odd or even rows with some odd index (-3 or something). That'd be awesome (and probably faster if there were too many rows to color, even with panel update deferred)!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.