Find DataRecord from DataItem for Infragistics DataPresenter - infragistics

I'm trying to retrieve the DataRecord associated with a given data item bound to my XamDataGrid. Is there any way to find the DataRecord other than enumerating through all the DataRecords in the collection and comparing the DataRecord.DataItem to the dataItem in question?

There is a GetDataRecordFromDataItem method exposed by the DataRecordCollection and this could be used to get a DataRecord from the DataItem
http://help.infragistics.com/NetAdvantage/WPF/2011.2/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v11.2~Infragistics.Windows.DataPresenter.DataRecordCollection~GetDataRecordFromDataItem.html

Related

Add to list within document MongoDB

I have a database where I store player names that belong to people who have certain items.
The items have and IDs, and subIDs.
The way I am currently storing everything is:
Each ID has its own collection
Within the collection there is a document for each subID.
The document for each subID is layed out like so:
{
"itemID":itemID,
"playerNames":[playerName1, playerName2, playerName3]
}
I need to be able to add to the list of playerNames quickly and efficiently.
Thank you!
If I understood your question correctly, you need to add items to the "playerNames" array. You can use one of the following operators:
If the player names array will have unique elements in it, use $addToSet
Otherwise, use $push

Append QStandardItem in two QStandardItemModel at the same time

First I want to thank you in advance for your answers. I insert one QStandardItem in one QStandardItemModel and then display this model in a Tree View (A). After this I append the same item (pointer) to a new QStandardItemModel wich is associated with another Tree View (B). It is only displayed one empty item instead one item with the same text in this second case. If I make a copy of the item, the result the expected. Why can I not append the same item in two different models?
In this case is not useful to use QSortFilterProxyModel because modelA and modelB have the same data but following a very different structure.
Thank you very much.
If it is not possible to do this, which solution you suggest me? I though maintaining a correspondence between table models by using hash tables, but I think there is a easier solution.
I copy one code example.
QStandardItem * item = generateExampleItem();
modelA->invisibleRootItem()->appendRow(item); // will be visible to the user
modelB->invisibleRootItem()->appendRow(item); // will be invisible to the user
ui.treeViewA->setModel(modelA);
ui.treeViewB->setModel(modelB);
ui.treeViewA->show();
ui.treeViewB->show();

Sharepoint: Establish related records when new item being added to list

What is the best way to implement a parent-child hierachy between items in a list? The requirement is as follows
-> there is a list item with a particular ID
-> that particular ID could have related records.
-> all those related records should show up when viewing the list item
When the user adds a new item to list using a form, they should have the option to choose whether the new item being added has another related item or not.
The primary question here is what would be the best way to establish this hierarchy in the list? Also, all the items would be in the same list so how
would we link the list to itself? Or, what would be the best way to implement this? I can figure out several approaches to handle this within the confines of the
sharepoint server object model; however, this needs to be done primarily within the UI of Sharepoint itself (webparts, features, etc. may be used). However,
I am not sure how to IMPLEMENT THIS WITHIN THE SHAREPOINT CONTAINER ITSELF.
Any ideas/insights would be greatly appreciated.
Thanks
You can create a look up column in list with a parent list as itself and allow multiple selections. That way you will be able to check multiple parent IDs for a specific list item.
To show related list items, you can customize details view page of the list in sharepoint designer and add list view web part or dataview with appropriate filters based on the current item.

How do I hide data/field in a List in J2ME

I am working on a J2ME app which has dynamically generated Lists. Items on this list may be consequently selected, and the selection processed within the commandAction block.
Is there a way to have the IDs of variables populating the List (from a remote database) included in the List item definition as in:
this.append("A", null);
this.append("B", null);
or:
String[] arrayOfValues = {"A", "B"};
new List("Menu", List.IMPLICIT, arrayOfValues, null);
such that when an item is selected, perhaps A, I can also have its database ID for perhaps further processing. Is it possible to hide a field/data? Thanks.
You can extend List
Add an void append(MyNewClass) method to your extended List class.
MyNewClass contains both the String you will append to the List and your database ID
Keep an additional container in your extended List class and make sure that List.getSelectedIndex() allows you to find the correct MyNewClass object in the container.

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

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.