How to get the cursor on a datalist as you type part of it ?
In case I am using a DataGrid is there any way to move the pointer to the specific data item in it's column ,as I type part of its begining text in a textBox ?
This is possible if a listbox is used instead,using the SendMessage function
but a ListBox takes long to load everytime.
Is there any other way this can be accomplised by using any different control ?
Pls advice
[409 byte] By [
joan] at [2007-11-11 10:14:19]

# 2 Re: How to get the cursor on a datalist as you type part of it ?
If you are using an ADO recordset for the source of your datagrid then you can use the GetRows function to retreive an array of the contents of the recordset. After that you would need to loop through the array and compare each element to the value being typed in. I suggest you only load the array when the datagrid is loaded or refreshed. This will reduce the time it takes to search the array for your data. If you find a match then you will know what record and what column the match was found. Be warned though in the array the first element indexes the Field or column and the second element of the array indexes the row. Value = grArray(Column, Row)
Syntax
array = recordset.GetRows( Rows, Start, Fields )
Rows - the number of records to retrieve
Start - A String or Variant that evaluates to the bookmark for the record from which the GetRows operation should begin
Fields - A Variant representing a single field name or ordinal position or an array of field names or ordinal position numbers