Developing a User Interface > C1QueryFrame Control > Using C1QueryFrame Properties, Methods and Events > Item Navigation |
A C1QueryFrame control’s content is a collection of items, conditions or result fields, depending on the value of the ContentsType property. Each item has its own unique identifier – the item id, uniquely determining its position in the hierarchy of query items.
Special methods of the C1QueryFrame.Item object allow the programmer to access an item by its id and to navigate the item hierarchy, see Accessing and Modifying Query Items.
The id of the current (currently selected by the user) item is returned by the CurrentItemID property. To access the properties of the currently selected item, use the following code (see Accessing and Modifying Query Items for details):
Example Title |
Copy Code
|
---|---|
C1QueryFrame1.Item.FindByID C1QueryFrame1.CurrentItemID
If (Not C1QueryFrame1.Item.Complex) And (Not C1QueryFrame1.Item.Advanced) Then
' If it is a simple elementary condition, do something
End If
|
The CurrentItemID property can be set programmatically, moving the selection to a desired item.
When the end user changes the selection, moves to another item, the ItemFocusChange event is fired. This event is also fired when the end user moves between elements of the same item (for example, from left side to comparison, or from comparison to right side).
To find out which element of the current item is currently selected by the end user, use the CurrentElement property of the Item object, as in the following code:
Example Title |
Copy Code
|
---|---|
C1QueryFrame1.Item.FindByID C1QueryFrame1.CurrentItemID
If C1QueryFrame1.Item.CurrentElement = c1qElemTypeConn Then
' If it is a connective, do something
End If
|
In order to programmatically move the selection to an element inside the currently selected item, use the SetCurrentElement method.