Grid parts and tree parts find and position focus

Source: Internet
Author: User

In grids and tree parts, it is often necessary to find a row of data in a grid or tree based on a field value or a key value, and to locate the focus, how do you implement such a function? 1, grid parts find positioning:
In the grid part, we can loop through the number of rows displayed, get the values to compare with the lookup values, and the code is as follows:

For I=1 to mesh part 1. Gridview.rowcount If CStr (mesh Part 1. Getfieldvaluebyrowhandle (i-1, "name")) = "Zhang San" then grid Part 1. Focusedrowhandle=i-1 End IfNext

You can also use the Setfocusrowbycolumnvalue method.

Grid Part 1. Setfocusrowbycolumnvalue ("name", "Zhang San")

2, in the tree-type parts, you can use Setfocusnodebycolumnvalue or setfocusnodebykeyvalue to find the node according to the field value or keyword, respectively:

Tree-type Part 1. Setfocusnodebycolumnvalue ("name", "Zhang San")

Based on key values:

Tree-type Part 1. Setfocusnodebykeyvalue ("Key value ID")

> Note: The key value ID is the value of the key Value field set in the tree part property, which forms the tree with the ancestor ID.

above is the method of locating the focus line based on the data of the grid part and the tree part.

Original address: http://bbs.delit.cn/thread-282-1-1.html

Reprint please specify the source:

Author: metric Technology http://www.delit.cn

Grid parts and tree parts find and position focus

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.