We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

How to double click on SfGridDataControl cell in UFT

Hello, I'm working on test automation of one app which use Syncfusion.Windows.Controls.Grid.GridControl (I get this type from Snoop WPF inspector app.)
Unfortunatelly UFT could not recognize this table, so it was added to OR manually with type SfGridDataControl. But for some reason UFT-exposed methods for SfGridDataControl not working propelply 
(I could not select cell, get amout of cells and rows). So to do something I have to deal with native methods and properties that I could reach from SfGridDataControl("MyGridName").Object.
With such aproach, I'm able to get amount of cols and rows in this grid, navigate to specific cell, get cell values, etc. But I'm not able to double click cell, which I need to testing. I've tryed to get Rect of selected cell 

WpfWindow("App").SfGridDataControl("Grid").Object.CurrentCell.MoveTo 5,5
Set range = WpfWindow("App").SfGridDataControl("Grid").Object.CurrentCell.RangeInfo
print range.Info

And actually range.Info - return me record R5C5 but when I'm passing it to 
Set rect = WpfWindow("App").SfGridDataControl("Grid").Object.Model.ActiveGridView.RangeToRect(range) - I'm getting exception that range is empty. I also tryed to call method  RangeToClippedVisibleRect - it result was the same.

Also I was trying to use RaiseEvent method but unfortunatelly I was not able to create  GridCellClickEventArgs object to pass it as argument.

Thank you for help.

3 Replies

SM Saravanan M Syncfusion Team April 15, 2015 06:43 PM UTC

Hi Pavlo,

Thank you for contacting Syncfusion support,


For Query DoubleClick:

We have exposed SetCellData method to set the Cellvalue in GridDataControl, so when you entered into edit mode SetCellData method will call by default. If you requirement “Double Click” purpose is different from this, could you please share your purpose for calling DoubleClick method? So that we can analyze further on this query and provide you the better solution.

For Query ExposedMethods and RaiseEvent method

We have checked with our side, we are able to use our methods for GridDataControl, which are provided for UFT. You can use RowCount, ColumnCount property to get the Number of Rows and Columns in GridDataControl. You can use SetCurrentCell method to move CurrrentCell by passing RowIndex and ColumnIndex. We have provided the UFT supports for GridDataControl only exposed methods , so we request you to use exposed methods for GridDataControl instead of deal with native methods and properties.

Code snippet:

WpfWindow("App").SfGridDataControl("Grid").SetCurrrentCell 10,1

WpfWindow("App").SfGridDataControl("Grid").RowCount

WpfWindow("App").SfGridDataControl("Grid").ColumnCount

WpfWindow("App").SfGridDataControl("Grid").SetCellData 12,13,”ALFKI”



Please let us know if you have any other queries,

Regards,

Saravanan.M








PM Pavlo Mashurenko April 16, 2015 08:10 AM UTC

Thank you for ansver Saravanan,
no, I do not need to edit cells. In my case double clicking cell will open new report with grid which data wil be based on data in selected cell. 



EM Elavarasan M Syncfusion Team April 20, 2015 03:52 AM UTC

Hi Pavlo,

We have analyzed your query and our GridDataControl enters into the edit mode when you double click the cell, so we have provided support to set the value using SetCellData method by passing RowIndex , ColumnIndex and value as parameter. In your scenario you would like to open the new window when you double click the cell but we didn’t provide method to open any new object like not exposing any event to handle. As we mentioned in our last update , could you please use the exposed methods for GridDataControl in QTP environment.

Please let us know if you have any other queries,

 

Thanks,

Elavarasan M

Loader.
Live Chat Icon For mobile
Up arrow icon