Ask a Question

find a value in cells of datagridview

SOLVED
mrezahoseini
Contributor

find a value in cells of datagridview

Hello,
I would like to retrieve a value of a cell (Search) in DataGridview
I used this manual too : http://support.smartbear.com/viewarticle/63253/

 

but unfortuantly, when I used the sample code of this manual, I saw that there is no "wValue" property and also my datagridview hasn't got this property.

 

what shall I do?

 

this is my sample code : 

 

 

function Select()
{

var p, Grid, RowIndex;

Grid = Aliases.BankingWinUI.frmIssuer.tableLayoutPanel1.entityDataGridView12.dgvMain;  // this is the path of my datagridview from namemapping


RowIndex = FindRow (Grid, "عنوان", "بانک دی");
if (RowIndex >= 0)
Grid.ClickCell (RowIndex, "عنوان");
else
Log.Error ("Row was not found.");

}


function FindRow (Grid, ColumnId, Value)
{

for (var i=0; i<Grid.RowCount; i++)

if (Grid.wValue(i, ColumnId) == Value) //can not compile this line, not recognize
return i;

return -1;
}

 

 

 

This is the snapshot of my datagridview's properties

 

 

 

Untitled.png

 

mahnazrezahoseini
8 REPLIES 8
NisHera
Valued Contributor

what is your grid?

is it compiled as said in TC documentation?

mrezahoseini
Contributor

Excuse me, what do you mean?

 

I used f10 for compiling and also some breakpoints have been set in my program.

 

Thanks for your attention

mahnazrezahoseini
HKosova
SmartBear Alumni (Retired)

Hi mahnazreza,

What is your grid's class name (the ClrFullClassName property)?


Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

Hello

 

This property has this value : "Kishware.UI.Windows.Forms.EntityDataGridView"

 

Thanks for your attention

 

Regards

 

 

mahnazrezahoseini
HKosova
SmartBear Alumni (Retired)

Your grid appears to be based on the standard .NET DataGridView. So you need to add the the grid's class name (Kishware.UI.Windows.Forms.EntityDataGridView) to Tools > Current Project Properties > Object Mapping > Microsoft Controls > WinForms > DataGridView. This will enable advanced recording and playback using the wValue, ClickCell and other properties and methods.


Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

Thank you very much indeed. my problem is solved.

mahnazrezahoseini
Raju506315
Occasional Contributor

Where is tool option

It's the "Tools" menu on the TestComplete menu bar

 

 


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
cancel
Showing results for 
Search instead for 
Did you mean: