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
Need to find Datagrid without giving the ControlName
-
- Posts: 8
- Joined: Mon May 19, 2008 2:35 pm
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
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
Perhaps it's a good idea to read the Ranorex User Guide, especially the Quick Start page!
Regards,
Alex
Ranorex Support Team
-
- Posts: 8
- Joined: Mon May 19, 2008 2:35 pm
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
// 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
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
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:
Regards,
Alex
Ranorex Support Team
Code: Select all
Control dataGridControl = form.FindControlId(1234);
DataGrid dataGrid = new DataGrid(dataGridControl.Handle);
Alex
Ranorex Support Team
-
- Posts: 8
- Joined: Mon May 19, 2008 2:35 pm
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
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
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
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!
Regards,
Alex
Ranorex Support Team
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.palanikumar.m wrote:Could you plz, call my number. Or, can you give me your contact number?
Regards,
Alex
Ranorex Support Team