Note that there are some explanatory texts on larger screens.

plurals
  1. POWhite UI Automation : Get WPF DataGrid cell value?
    text
    copied!<p>I'm very new to white project, and I wast just checking its features... In my work, I deal intensively with wpf &amp; datagrids, I couldn't get the value of datagrid cell when the column is DataGridTemplateColumn.</p> <p><strong>It's not for DataGridTemplateColumn only, It's is for all column types.</strong></p> <p>my datagrid was as:</p> <pre><code> &lt;my:DataGrid AutoGenerateColumns="False" Margin="25,28,42,34" Name="dataGrid1" &gt; &lt;my:DataGrid.Columns&gt; &lt;my:DataGridTemplateColumn Header="Header" x:Name="koko" Width="200"&gt; &lt;my:DataGridTemplateColumn.CellTemplate &gt; &lt;DataTemplate &gt; &lt;TextBlock Name="moko" Text="{Binding col1, Mode=OneWay,Converter={StaticResource fataGridHighlightConverter }}" &gt;&lt;/TextBlock&gt; &lt;/DataTemplate&gt; &lt;/my:DataGridTemplateColumn.CellTemplate&gt; &lt;my:DataGridTemplateColumn.CellEditingTemplate&gt; &lt;DataTemplate&gt; &lt;Grid x:Name="myEditGrid" Loaded="myEditGrid_Loaded"&gt; &lt;/Grid&gt; &lt;/DataTemplate&gt; &lt;/my:DataGridTemplateColumn.CellEditingTemplate&gt; &lt;/my:DataGridTemplateColumn&gt; &lt;/my:DataGrid.Columns&gt; &lt;/my:DataGrid&gt; </code></pre> <p>and my Test was:</p> <pre><code> [Test] public void TestDatagrid5() { var tab = _win.Get&lt;ListView&gt;(SearchCriteria.ByAutomationId("dataGrid1")); var count = tab.Rows.Count; var row = tab.Rows[1]; ListViewCell x = row.Cells[1]; //Always count = 0 :( } </code></pre> <p>but the cell count is always = 0, I need to get cell value !!!? any help please!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload