Forum Discussion

mrezahoseini's avatar
mrezahoseini
Contributor
10 years ago

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

 

  • HKosova's avatar
    HKosova
    10 years ago

    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.

  • NisHera's avatar
    NisHera
    Valued Contributor

    what is your grid?

    is it compiled as said in TC documentation?

  • 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

    • HKosova's avatar
      HKosova
      SmartBear Alumni (Retired)

      Hi mahnazreza,

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

      • mrezahoseini's avatar
        mrezahoseini
        Contributor

        Hello

         

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

         

        Thanks for your attention

         

        Regards