How do you get child bands in ultragrid without using related tables in a dataset? - infragistics

I'm using linq to pull back an object (i.e. customer) that might have a collection of other objects(customer.orders). I would be nice if I can pass this list of customers to the ultragrid and a hierarchical view of customers and thier orders displayed on databind. When I try this, I just get customers. Anyone know how to get this to work with non dataset objects?

Figured it out. IList collection works and will create bands for properties of your domain object if it is an IList<T>. Just make sure thatDisplayLayout.ViewStyle = ViewStyle.MultiBand.

I've tried the following and it didn't work:
DisplayLayout.ViewStyle = ViewStyle.MultiBand
I read from this blog that it must be List and not IList in order to work, and it did.

We work with our own custom datasource for grid, so we first create a structure of bands and then we initialize data OnDemand, handling events
InitializeDataRow
InitializeRowsCollection
CellDataRequested
We use Tags to navigate through the structure.

Related

Best practice for using Django templates and connect it to database

I am trying to build a database for my website. There are currently three entries with different attributes in my database. I have not created these entries in order, but I have assigned a 'Chapter number' attribute which indicates the order 1,2,3.
I am now trying to inject this using 'context' and 'render' function in my views. I am using the method 'objects.all()' to add all objects to my context. I have a simple Html file where I am inserting the data from the database by looping over (a simple for loop) these added objects.
Now the output that is being generated (naturally) is that it is following the order in which I created the database. I am not sure how I can have the loop run in such a way that I get these chapters in correct order. Thank you for patiently reading my question. Any help will be appreciated.
You may use the order_by method which is included in Djangos QuerySet API:
https://docs.djangoproject.com/en/3.0/ref/models/querysets/
If you offer some more information of your specific data I might provide you with an example.
For orientation purposes, sorting queried objects by date would work as follows:
most_recent = Entry.objects.order_by('-timestamp')
You can sort by any field like so:
sorted_by_field = Entry.objects.order_by('custom_field')

PowerApps: Filter by user no delegation

Need some help with PowerApps - I am trying to filter the gallery where the Person column (ROMEmail) equals the logged in user.
This code is working, but the blue circle of death comes up - whilst in test at the moment, i dont have over 500 records, but will do within a month of trialling this
Any ideas on how to workaround this? Using a collection or variable perhaps? I haven't really used these yet so a detailed resolution would be greatly appreciated.
SortByColumns(Filter('Reviews', StartsWith(LocationName, TextSearchBox1.Text),ROMEmail.Email = User().Email), "Modified", If(SortDescending1, Descending, Ascending))
A collection would be your best choice.
To add a collection in your app replace the code where you grab your data by something like this:
ClearCollect(localData,'Reviews')
This collects all the data in a locally collection. The ClearCollect replaces all your data by the new ones.
After this you can sort and filter directly on your collection. For example in a gallery. Using your code it would look like this:
SortByColumns(Filter(localData, StartsWith(LocationName, TextSearchBox1.Text),ROMEmail.Email = User().Email), "Modified", If(SortDescending1, Descending, Ascending))

Django Inline with join table structure

So I have a DB structure like so: (ignore how i named things its a quick fake DB example things)
Collection: id, ...
List: id, title,...
Car: id, name, ...
CollectionHasList: id, collectionid, listid
ListHasCar: id, carid, listid
So what I am trying to do is in the django admin panel under collection/add I want to be able to fill in all of these tables instead of filling everything in individually one by one.
So the collection fields will exist as normal, but then I want to have a custom field that takes in a list title and a text area that takes in a comma delimited cardIds (cards are already created and don't need to be done through here, just list and collections) But since Collections have many lists, I want to be able to click a "add" button and generate the same custom form again to add more lists (with associated cars).
I think in the model I will be able to do the custom saving that I need, but I can't get the form to work and thats what I need most help on. Can anyone please help me! Thank you so much! I looked everyone on stack overflow and haven't found anything that can directly help me, some good points, but I still can't put it together.

Selectable cells in UITableView with ProMotion

I’m getting crazy with Pro Motion table and I cannot find any discussion about this online.
I’m using a PM::TableScreen and I need to have selectable table rows. I manage the raw selection in an array but I don’t know how can I get the cell object to call cell.accessoryType = UITableViewCellAccessoryCheckmark if is selected or cell.accessoryType = UITableViewCellAccessoryNone if not selected.
Here is the gist of my screen: I try to intercept the cell passing a value in the arguments (row) but I cannot find a method to get the cell object.
In my original idea the place for the selection is inside my tapped_cell method byt maybe there is a better way to manage a multiselection.
My Gist
You don't want to memoize the table data. I've created a pull request with the fix:
https://github.com/robypez/rm_quiz/pull/1
Hard to summarize here, although I know Stackoverflow doesn't like us relying on links.

JSF selectOneMenu not whole List

Is it possible to choose only specific items from the list in selectOneMenu?
For example. I have List Products has many fields like name, id etc. One of it is category (1,2 or 3) I want to have only one category in the selectOneMenu without making new Lists and new classes. Can you help me?
I think the easiest way is to set the value attribute of f:selectItems to a method which filters your original collection.
Otherwise you'd have to implement your own version of f:selectItems which allows filtering - as we once did in one of our projects.