Forum Discussion

pashooo's avatar
pashooo
Contributor
14 years ago

not supported type of wValue of DataGridCell

I add a grid to MicrosoftControls/DataGridView (screenshot 1)

This is my grid (scrennshot 2)

When I want to get WValue of DataGridCell (screenshots 3,4) - I have got an error (screenshot 5)

All of cells contain integer numbers, why this type is not supported?

3 Replies

  • Hi Pasha,



    The Microsoft Controls > DataGridView category is actually for WinForms (not WPF) grid classes. WPF grid classes are in the Microsoft Controls > WPFToolkitDataGrid category, and System.Windows.Controls.DataGrid is already there by default.



    So, remove this class from the Microsoft Controls > DataGridView category and try once again.



    If the error still occurs, note down the grid's Columns.Item(<index>).ClrFullClassName property value for each column index, add these classes to the Microsoft Controls > WPFToolkitDataGrid > TextColumn category and see if this helps.



    Let me know your results.

  • Hi, Helen.



    I added the grid's Columns.Item(<index>).ClrFullClassName property (screen 11111111.png) to the Microsoft Controls > WPFToolkitDataGrid > TextColumn (screen 22222222222222.png)

    Then choose row - "0", column - "0" cell and get other error... (screen 4444444444444444444.png)



    I'm sure that application didnt stop responding.

    Not sure about incorrectly compilation.....



    What, in your opinion, the reason of the error?

  • Hi Pasha,



    I'm afraid, the wValue property doesn't currently support DataGridTemplateColumn columns, because they are custom-implemented by the application developers, and there's no way for TestComplete to know how to get values displayed in these columns.



    In this case, I'd recommend getting data from the grid using its native properties and methods - those from the .NET category in the Object Spy. For example, you'll probably be able to get the needed values directly from the underlying data source using the Items.Item(<index>).<DataFieldName> property.