| View previous topic :: View next topic |
| Author |
Message |
palanikumar.m
Joined: 19 May 2008 Posts: 8
|
Posted: Tue May 20, 2008 12:44 pm Post subject: Need to find Datagrid without giving the ControlName |
|
I need to find one DataGrid from Form. But i dont know the ControlName. Because RanorexSpy didnt give the ControlName. it gives the Classname and controlID only.
Now, how i find the DataGrid?
Plz, help for this problem!!!!!!!
Thanks & Regards,
Palani |
|
| Back to top |
|
 |
Support Team Site Admin
Joined: 07 Jul 2006 Posts: 344
|
Posted: Tue May 20, 2008 2:39 pm Post subject: |
|
The Control Id is usually sufficient to uniquely identify a control (unless it's a .NET control which have dynamic control ids). Just use one of the Control.Find... methods (e.g. FindControlId or FindButton(Int32 controlId)) to search for the datagrid.
Perhaps it's a good idea to read the Ranorex User Guide, especially the Quick Start page!
Regards,
Alex
Ranorex Support Team |
|
| Back to top |
|
 |
palanikumar.m
Joined: 19 May 2008 Posts: 8
|
Posted: Tue May 20, 2008 4:13 pm Post subject: Need to find Datagrid without giving the ControlName |
|
DataGrid dataGrid = form.FindDataGrid("dataGridView1");
// Reading colum text of column 1
String columnText = dataGrid.GetColumnText(1);
Console.WriteLine("DataGrid ColCount = {0} ", dataGrid.ColumnCount);
instead of above suppose, if i am using,
DataGrid dataGrid = form.FindControlId("...");
(or)
DataGrid dataGrid = form.FindClassName("...");
It asking the cast converter, What i need to give for cast conversion?
Thanks & regards,
Palani |
|
| Back to top |
|
 |
Support Team Site Admin
Joined: 07 Jul 2006 Posts: 344
|
Posted: Tue May 20, 2008 5:43 pm Post subject: |
|
The FindControlId method returns a Control instance even if the found control is indeed a datagrid. However, if you know that the returned control is a datagrid, you can construct a DataGrid object in the following way:
Code: click into code to enlarge
Control dataGridControl = form.FindControlId(1234);
DataGrid dataGrid = new DataGrid(dataGridControl.Handle);
Regards,
Alex
Ranorex Support Team |
|
| Back to top |
|
 |
palanikumar.m
Joined: 19 May 2008 Posts: 8
|
Posted: Wed May 21, 2008 10:11 am Post subject: got exception when using datagrid |
|
Hi Alex,
I have inserted code, what you have suggested me.
But i got exception in a form.FindControlId and dataGridControl.Handle
I got the below exception :
"Function evaluation disabled because a previous function evaluation timed out............."
I feel very hard to describe all those things.
Could you plz, call my number. Or, can you give me your contact number?
Because, Now i am evaluating the testing tools for select one.
if problem solved, my company will purchase this tool.
My contact details :
M.Palanikumar,
Mobile : +91 9941239091
Off : +91 44 67422312 |
|
| Back to top |
|
 |
Support Team Site Admin
Joined: 07 Jul 2006 Posts: 344
|
Posted: Mon May 26, 2008 3:50 pm Post subject: |
|
I only know this kind of error message ("Function evaluation disabled because a previous function evaluation timed out") from the Visual Studio debugger when you are stepping through code slowly. Please, try to set a breakpoint at the exact point in the code that you want to inspect!
| palanikumar.m wrote: |
| Could you plz, call my number. Or, can you give me your contact number? |
I am sorry, but at the moment we do not provide telephone support. You can, however, contact us via email at support_at_ranorex.com.
Regards,
Alex
Ranorex Support Team |
|
| Back to top |
|
 |
|