Jump to content
Sign in to follow this  
YogeshDikshit

Get the selected row value from a grid control

Recommended Posts

YogeshDikshit

HI!

Can anybody pls help me - how to get the selected value from a read-only grid control? The grid control has X(rows) and Y(columns) which can vary if needed. Does Autoit have any function to do this?

Thanks,

Yogesh

Share this post


Link to post
Share on other sites
PsaltyDS

Grid controls are drawn by their parent applications without using the standard Windows APIs. As a result, AutoIt has no way to know how to interface with them.

If you can navigate around in it with the keyboard, then you can ControlSend() "{TAB}"/"{UP}"/"{DOWN}" stuff to move around, and then ControlSend() "^c" to copy text.

:mellow:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
YogeshDikshit

Grid controls are drawn by their parent applications without using the standard Windows APIs. As a result, AutoIt has no way to know how to interface with them.

If you can navigate around in it with the keyboard, then you can ControlSend() "{TAB}"/"{UP}"/"{DOWN}" stuff to move around, and then ControlSend() "^c" to copy text.

:mellow:

Thanks for your reply.

Using Autoit Window Info following info is displayed....

So can we use any of these info (without using coords OR Mouse Move/Click events OR Send() function)? because I don't want the script to be hardcoded

<<Window>>

Property Value

Title MyWindow

Class classMyWinMainFrame

Position 612, 1

Size 626, 650

Style 0x14CF0000

ExStyle 0x00000100

Handle 0x000307EE

<<Control>>

Property Value

Class SysListView32

Instance 1

ClassnameNN SysListView321

Name

Advanced Mode [CLASS:SysListView32; INSTANCE:1]

ID 1001

Text List1

Position 12, 60

Size 411, 304

ControlClick Coords 71, 80

Style 0x5601018D

ExStyle 0x00000325

Handle 0x0002085C

BR,

Yogesh

Share this post


Link to post
Share on other sites
picaxe

Au3Info shows it is a listview, so try adapting this example.

Share this post


Link to post
Share on other sites
YogeshDikshit

Au3Info shows it is a listview, so try adapting this example.

Thank you Sir. Thank you very much.....

Now I am facing the problem to identify the selected item from the list. The selection is made through mouse or keyboard; is there any function to get the selected / focused item from the list...?

Share this post


Link to post
Share on other sites
PsaltyDS

Thanks for your reply.

Using Autoit Window Info following info is displayed....

<snip>

<<Control>>

Property Value

Class SysListView32

Instance 1

ClassnameNN SysListView321

Name

Advanced Mode [CLASS:SysListView32; INSTANCE:1]

For the record, that's NOT a grid control...

:mellow:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
YogeshDikshit

Thank you guys... Thanks a lot for your guidance

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×