I wish to apply a background color to ONLY the cells in a specific dataGrid column? - livecode

I asked this question on the LiveCode email list. No response, so I figure it must not be possible. I know about editing the template graphic that enables alternating row colors. That doesn't help me.
This lesson is the closest to what I have found, but it only sets the overlay color to empty cells. It also had an unwanted affect, where any data that was present in the grid no longer shows up.
http://lessons.runrev.com/s/lessons/m/datagrid/l/7327-how-do-i-override-the-default-behavior-for-rendering-data-to-a-cell
As a little experiment, since the data became invisible (note that I'm on WinXP), I tried placing an opaque graphic over the column I wish to colorize. I set the ink of the graphic to AddMax or AddOver, and it looked nice, but the text in the cells disappeared. Then I tried setting the ink to AddMin, and it still looks good, but the test shows through!!!!
So, I think this will work fine visually, but how can I pass a double-click through this graphic to the cell underneath (to allow cell editing only within this column)?

Yes, you can do this.
This suggestion comes from Trevor DeVore at http://www.bluemangolearning.com/
Create a custom column template using the property inspector. From there you can edit the behavior of the column to colorize the background color of the field for that column or just edit the field in the template group to change the color.
The background color will only show up in rows that have data, however.

Related

Excel - how to hide value in a chart's datalebel

I have embedded an image to a chart's datalabel. I want to only keep the image and not the value which appears on top of the image.
However I'm not sure how i can get rid of the value to only show the image?
I thought could've set the font colour to transparent but that's not available. I also played around with the number formatter but had no luck?
I'm using Windows/Excel 2010
Thanks
Clicking on one of the data labels once will select all of them, clicking a second time will select only the one you clicked on. Then just hit the delete button. (You should also be able to edit the font/colour in the Home tab.)

Auto Grouping/Merging in Excel

I think the image attached describes better than I can in words the functionality I am trying to locate within excel.
Is there a way to auto group based on the contents within the columns as shown? This is achievable for the example shown, but when there are up to say 30 Groups and many sub group types, I am wondering whether excel can auto-detect and work its way through the list, grouping as shown as it goes.
You can get a similar result using conditional formatting. select the whole table and create a new conditional format rule and choose formula and enter =A1=A2 set the format font to white (I've used very light grey to show that the data is still there)
To get the borders, do the same again and this time enter the formula =A1<>A2 and make the top border black.
It's not exactly the same as yours but it's close.

TableWrapData: widgets won't left align properly

My program uses TableWrapLayout with numColumns set to 2. I then have the following code: (background colors are set to show you that the widgets aren't using the blank space).
Label label = toolkit.createLabel(container, "Resource Type":);
label.setLayoutData(new TableWrapData(TableWrapData.LEFT,TableWrapData.MIDDLE));
label.setBackground(DiagramSettings.NODE_BACKGROUND_COLOR);
resourceComboMenu = new Combo(container, SWT.READ_ONLY);
resourceComboMenu.setBackground(DiagramSettings.NODE_BACKGROUND_COLOR);
resourceComboMenu.setLayoutData(new TableWrapData(TableWrapData.LEFT,TableWrapData.MIDDLE));
However as you can see in the picture the combo box refuses to left align properly. But that I mean I want it to start right after the label, not have a bunch of blank space.
One workaround would be to put the row inside it's own Composite just like I do Resource Icon and Geolocation. But I feel like I shouldn't need to since the widgets on this row equals the number of columns set by the layout. I've created this workaround for now but would like to understand this TableWrapData behavior for the future.
Any insight would be helpful, thanks.
I pretty much answered my question in the question. The composite that contains everything in the picture had TableWrapData with columns set to 2. TableWrapData essentially draws a straight, vertical line between each column then makes sure widgets from one column don't cross it.
So to fix this (like I mentioned in my question) you simply make another composite with nested widgets (which in the case would be the resource type label and resourceComboMenu). I just didn't realize that is what you're supposed to do.

Change format of all data labels of a single series at once

I have an Excel 2010 chart, with several series. I have added data labels to one of the series. I want to change the font size of all labels of that series at once. Can it be done?
Note that if the contents of data labels are combinations of the three standard options in the Format Data Labels dialog ("Series Name", "X Value", or "Y Value"), I simply change the font size in the ribbon and it works.
But if data labels contain cell references (i.e., formulas), I could only change the font size of one label at a time.
I guess a macro would help. I tried something a while ago, and faced a sequence of problems (do not remember exactly which).
Anyone knows of a shorter/alternative solution?
It appears I found the cause.
Referring to the figure, whenever any of the cells referred to by the data labels is empty (e.g., deleting the contents of D4), I cannot change the font size.
If I reinstate D4, I can change the font size again. This is reproducible for the simple worksheet/chart of the figure.
According to this,
Workaround 1: Fill up all empty cells referred to. Change the format of labels. Remove added contents.
Workaround 2: Change to a dummy range for the data labels, which has no empty cells. Change the format of labels. Switch back to your intended range.
This might require The XY Chart Labeler, an excellent add-in by Rob Bovey.
This does not always work (there are cases where one cannot change font even with all non-empty cells), so there should be another possible cause for the problem (besides the one reported).
A workaround:
For the workbook, Save As... (you can even use the same workbook name). The problem goes away.
But if you close the file and open it again, the problem reappears.
Most of the times it works.
A workaround (found prior to #1):
A very poor solution, but which possibly saves quite a few keystrokes/mouse clicks in many cases. Select the whole chart, and change the font size in the ribbon. It will change all text. Then recover the font size of all other text but the data labels.
It won't work in charts with more than one series with such data labels, if you want them to have different sizes!
A quick way to solve this is to:
Go to the chart and left mouse click on the 'data series' you want to edit.
Click anywhere in formula bar above. Don't change anything.
Click the 'tick icon' just to the left of the formula bar.
Go straight back to the same data series and right mouse click, and choose add data labels
This has worked in Excel 2016. Purely by luck I worked this out saving a great deal of time and frustration.

Dynamics AX - Color multiple grid cells in different colors

In Dynamics AX 2012, is there a way to change the background color of multiple cells to different colors?
Order Status Ship Status Order ID
[green] [red] SO-1234
[green] [green] SO-1235
[red] [red] SO-1236
I've written a displayOption override that can change the color of one cell, but it seems to apply all the changes at the end, so whatever the last color you specify is the one that gets applied to all cells.
_options.backColor(46080); //green
_options.affectedElementsByControl(OrderStatus.id());
//is there anyway to apply the first change, so I can make a second one?
_options.backColor(255); //red
_options.affectedElementsByControl(ShipStatus.id());
In the code listed above, both cell background colors would be red.
Any suggestions?
Thanks
I had a similar task to accomplish, and I did not find a way to do it in Ax (well, techinically you could try Table control, but I strongly encourage you NOT to do so - you will end up swearing out aloud).
What I did is implemented a WPF user control and used this post as a template.
This is a small tutorial (found in Answer #7) which shows how to implement a cell background converter in built-in WPF data grid control, to accomplish the task.
After you have it implemented you can populate your datagrid by using LINQ (if using AX 2012 R2), web services, or passing a temporary table - there are many ways to access AX data.
It may not be the ultimate solution, but it works.
I did it using a table control ( although Maciej advised you not to do ).
It works without problems.
You need to add a table control which gets your data and set the property
ColorScheme to RGB
Then, override the FormControl editControl(int column, int row)
You can access each value by value = data.cell(column, row).data(); whereby data is the name of the table control.
Beware, that you have to add a control with the correct datatype to the table control and give it a name. Also set the ColorScheme property to RGB.
If you got RGB values for your desired background color, setting this color can be done by
RealEdit.backgroundColor(WinAPI::RGB2int(real2int(R),real2int(G),real2int(B)));
RealEdit is the name of the added control.
I've done this to display a matrix filled with values between 0 and 1 and to display a color gradient overlay with a range from green to red. See this link, if you like more information about the color conversion.

Resources