Changing column value in ultrawingrid - infragistics

I have an ultrawingrid from Infragistics which binds itself to a dataset. What I want to do is, for one of the columns I want to apply a converter.
That means, for a column that displays abbreviations for example, I want to display full names for each.
Is there a nice way to do such this in here. I know in WPF I could use converters.

In your InitializeLayout event you should place something like this
Infragistics.Win.ValueList vlAbbrevs = new Infragistics.Win.ValueList();
vlAbbrevs.ValueListItems.Add("F", "Female");
vlAbbrevs.ValueListItems.Add("M", "Male");
vlAbbrevs.Key = "_ABBVS_";
e.Layout.Bands[0].Columns["Gender"].ValueList = vlAbbrevs;

You could use a DataFilter. The following is an overview of data filters: http://help.infragistics.com/NetAdvantage/WinForms/current/CLR2.0/?page=WinGrid_About_Data_Filters.html
The following blog post has an example:
http://blogs.infragistics.com/winforms/articles/using-an-wingrid-datafilter-to-convert-strings-to-bools-and-vice-versa-for-a-checkbox-column.aspx

Related

How to set two filtering values in one column of links in an interactive report? (Oracle Apex 21.1)

I need help creating a link in Oracle APEX.
I have two Interactive Report pages created in Oracle APEX.
The first page is an Interactive Report for a list of cats. When clicking on that link, filter the second page's Interactive Report by the "fur color" column. Furthermore, I want to always be "white" in addition to the color of the selected row.
I try 2 types of methods to create a link in Link Builder.
Name = IR_FUR_COLOR, Value = &P18_FUR_COLOR. and more one line Value = White
Name = IR_FUR_COLOR, Value = &P18_FUR_COLOR.,White
But they did not work.
How should I do it? Does anyone help me?
Thank you for watching this question!
Link Builder should contain only
Name: IR_FUR_COLOR, Value: &P18_FUR_COLOR
Modify the second Interactive Report's query so that its where clause looks like this:
where fur_color in ('white', :IR_FUR_COLOR)
which means that it'll always filter white color, along with any color you pass from the previous page.
There are variations to that approach; for example, you could create another (hidden) item on the 2nd page and pass white to it and then
where fur_color in (:HIDDEN_FUR_COLOR, :IR_FUR_COLOR)

Make form with dynamical amount of inputs in django template

The crux of the problem is this:
I have a Schema that will later be converted to a .csv file. However, I need to populate this schema with data. To do this, I need columns that will have fields (Name, data type, order, etc.)
But I don't know how many columns the Schema will have
Therefore, the wording sounds like this: Create a form with a dynamic number of columns.
While I was writing the question, I had an idea to create a "Scheme" table in the database and bind a table - "Column" to it
Thus, when you click "add column", a new instance will appear that will already be bound to this Schema.
Am I thinking in the right direction or do you have another idea?
The picture below will allow you to convey the essence of the problem more accurately.
Thank you in advance
If I was in your position, I would utilize HTMX. With that, when the "add column" button would be pressed, a new row would appear.
I would also do it the other way around from what I understand of your post, I would bind the column to the scheme like this
class Scheme(models.Model):
...
# rows of scheme
class Column(models.Model):
scheme = models.ForeignKey(scheme, models.CASCADE)
...
# rows of column

How to create multiple numbers of fields based on the value in one number field in Oracle Apex form?

I am working on a form in which I need to take numeric value from one field and based on that number(n) I need to create n fields for another column. How can I do so?
Probably you can use APEX_ITEM API if I understand your task right:
https://docs.oracle.com/en/database/oracle/application-express/19.2/aeapi/APEX_ITEM.html
Something like this:
SELECT APEX_ITEM.TEXT(rownum)
FROM DUAL
CONNECT BY rownum < :YOUR_ITEM;
You will not be able to create n page items in a declarative way. APEX simply wasn't made for this.
I can think of two workarounds:
Use a plsql dynamic content region to generate html with the apex_item package just like Ivan Dubashinskii suggested. You will need to submit the page in order to have the region re-generate your page items when the amount n is changed. There are some downsides to this approach, as for example it won't be that simple to use your page items in a page process.
Just limit your page items to some number, like 10. Then, create 10 page items in a declarative way and use dynamic actions to show/hide them when n changes. This way, it will also be much easier to use your items in a page procress.

How to put formula in Data Validation List Excel?

I am creating an excel sheet with following Data Validation drop down list.
NA
Done
(add some formula here)
Basically, i will be able to select either plain text "NA"/ "Done" from the dropdown list. But sometimes, I want the user to be able to calculate some values based on the cell respective to the row selected so, I want to have one formula as a choice inside the data validation dropdown list. Is this possible?
Data Validation List Source
When I click on Formulae option, it should execute the formula with respect to the cells in that Row
But currently, the formula that i put in doesn't execute, instead it will just show the whole formula in the cell when activated.
1)How can i make it so that when i select the formula from data validation list, it will execute it instead of filling up the cell with it?
2)How do i set the formula so that it will be using the cell from the current Row? (for example, if i am using the data validation List in N60, the formula should adapt itself to use the cell (let's say A60?).
I may not be able to help with the second part, but I was seeking an answer to the first and discovered a solution/workaround using Name Manager.
First, in Formula > Name Manager, create a new reference (the "refers to" will contain whatever formula you are wishing to ultimately display in the validation list. For this example, we use the formula reference "=IF($H54=..." and Name it "UniqueName"
Now, we go into Data Validation, Select List, and input the three items we want displayed in the list, with an equals sign preceding our newly named reference: ie. "NA,Done,=UniqueName"
Note: You can't start with the =UniqueName or validation will try to read it all as a formula and fail.
This method will allow the user to display "NA", "Done", or "=UniqueName" in the cell; if "=UniqueName" is selected, the cell itself will interpret this as a formula and execute it accordingly, displaying the results of "=IF($H54=...", or whateverelse you have designated to use as a named formula.
If it's too late for yours, I hope this helps someone else who may face a similar problem.
While I think I know what you're trying to say. Why don't you just use an IF formula to evaluate everything instead of selecting a drop down for every row manually. You already had it partially solved using IF. Just need to add the criteria for a "Done" and an "NA"
=if(A1="date","Done",if(A1<"date","NA",if(something else until you have all your catergories))
Just going to piggyback off of Mark's response.
If you really needed your named formula to be the first selection in the list, you can setup your list with a leading comma like so:
,=UniqueName,NA,Done
That worked out for my use, and there was no null item listed in the Data Validation drop down. Hope that helps!

Infragistics UltraGrid - How to use displayed values in group by headers when using an IEditorDataFilter?

I have a situation where I'm using the IEditorDataFilter interface within a custom UltraGrid editor control to automatically map values from a bound data source when they're displayed in the grid cells. In this case it's converting guid-based key values into user-friendly values, and it works well by displaying what I need in the cell, but retaining the GUID values as the 'value' behind the scenes.
My issue is what happens when I enable the built-in group by functionality and the user groups by a column using my editor. In that case the group by headers default to using the cell's value, which is the guid in my case, so I end up with headers like this:
Column A: 7F720CE8-123A-4A5D-95A7-6DC6EFFE5009 (10 items)
What I really want is the cell's display value to be used instead so it's something like this:
Column A: Item 1 (10 items)
What I've tried so far
Infragistics provides a couple mechanisms for modifying what's shown in group by rows:
GroupByRowDescriptionMask property of the grid (http://bit.ly/1g72t1b)
Manually set the row description via the InitializeGroupByRow event (http://bit.ly/1ix1CbK)
Option 1 doesn't appear to give me what I need because the cell's display value is not exposed in the set of tokens they provide. Option 2 looks promising but it's not clear to me how to get at the cell's display value. The event argument only appears to contain the cell's backing value, which in my case is the GUID.
Is there a proper approach for using the group by functionality when you're also using an IEditorDataFilter implementation to convert values?
This may be frowned upon, but I asked my question on the Infragistic forums as well, and a complete answer is available there (along with an example solution demonstrating the problem):
http://www.infragistics.com/community/forums/p/88541/439210.aspx
In short, I was applying my custom editors at the cell level, which made them unavailable when the rows were grouped together. A better approach would be to apply the editor at the column level, which would make the editor available at the time of grouping, and would provide the expected behavior.