I'm very new to white project, and I wast just checking its features... In my work, I deal intensively with wpf & datagrids, I couldn't get the value of datagrid cell when the column is DataGridTemplateColumn.
It's not for DataGridTemplateColumn only, It's is for all column types.
my datagrid was as:
<my:DataGrid AutoGenerateColumns="False" Margin="25,28,42,34" Name="dataGrid1" >
<my:DataGrid.Columns>
<my:DataGridTemplateColumn Header="Header" x:Name="koko" Width="200">
<my:DataGridTemplateColumn.CellTemplate >
<DataTemplate >
<TextBlock Name="moko" Text="{Binding col1, Mode=OneWay,Converter={StaticResource fataGridHighlightConverter }}" ></TextBlock>
</DataTemplate>
</my:DataGridTemplateColumn.CellTemplate>
<my:DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<Grid x:Name="myEditGrid" Loaded="myEditGrid_Loaded">
</Grid>
</DataTemplate>
</my:DataGridTemplateColumn.CellEditingTemplate>
</my:DataGridTemplateColumn>
</my:DataGrid.Columns>
</my:DataGrid>
and my Test was:
[Test]
public void TestDatagrid5()
{
var tab = _win.Get<ListView>(SearchCriteria.ByAutomationId("dataGrid1"));
var count = tab.Rows.Count;
var row = tab.Rows[1];
ListViewCell x = row.Cells[1]; //Always count = 0 :(
}
but the cell count is always = 0, I need to get cell value !!!? any help please!
I don't like this answer and would like to find a better way of doing this..
That said if you ask the ListViewRow item for the element in your grid you can then take the UiAutomationElement and create the White version of that element your self.