wpf datagrid type of control while in edit mode

Aug 11, 2009 at 10:24 AM
Edited Aug 11, 2009 at 10:27 AM

Hi,

 

When I am viewing a wpf datagrid, and I start to type in a new value for a cell, what is the type of the control used there during the edit operation?

 

My xaml looks like this:

 

dg:DataGridTextColumn Binding="{Binding FirstName}" Header="First Name" />

 

 

I run the application and there is a FirstName cell with Frank in it, I arrow to it and type Joe. At the point I start to type Joe, what is the type of control being used? For example, a DatagridTextColumn? A DatagridEditColumn?

 

I need to actually read the documentation on the type of control if there is any available.

 

Thanks!

 

/Justin

Aug 11, 2009 at 11:03 AM

A DataGridTextColumn uses a TextBox in its EditingElementStyle.

Aug 11, 2009 at 11:21 AM
Thanks much for the reply.
Can you please point me to any documentation on this control?
I need to read up on the interfaces that it exposes, properties, methods, etc.
thanks!

/Justin
----- Original Message -----
From: [email removed]
To: [email removed]
Sent: Tuesday, August 11, 2009 7:03 AM
Subject: Re: wpf datagrid type of control while in edit mode [wpf:65172]

From: mikj

A DataGridTextColumn uses a TextBox in its EditingElementStyle.

Aug 11, 2009 at 11:23 AM

Try here: http://msdn.microsoft.com/en-us/library/system.windows.controls.textbox.aspx

Aug 11, 2009 at 12:54 PM
Hi,
I am using UIA and programming a screen reader to interact with the editable cell which is to be a text box.
However, it doesn't appear to UIA that it is a regular text box and I can't get the text provider interface via UIA on whatever type of control this thing is while in edit mode in a cell.
Can someone please help me with this situation?
What control type or interface can I use to access the text box while in edit tmode in a datagrid row using UIA?
Help!

Regards,
Justin
----- Original Message -----
From: [email removed]
To: [email removed]
Sent: Tuesday, August 11, 2009 7:23 AM
Subject: Re: wpf datagrid type of control while in edit mode [wpf:65172]

From: mikj

Aug 11, 2009 at 7:05 PM
Hi all,
I haven't heard anything on this from anyone so hopefully someone is familiar with UI Automation and can assist me with this one. I could use some help.
What control type or interface can I use to access the text box while in edit mode in a datagrid row using Microsoft UI Automation?
I am using UI Automation and programming a screen reader to interact with the editable cell which is to be a text box. However, it doesn't appear to UIA that it is a regular text box and I can't get the text provider interface via UIA on whatever type of control this thing is while in edit mode in a cell.

Regards,
Justin

Coordinator
Aug 11, 2009 at 9:57 PM

Hi Justin,

The control which is displayed in edit mode of the DataGridTextColumn is indeed a TextBox (not a subclass of TextBox or a custom control of any sort).  I don't really have much experience with screenreaders, so I'm not sure why it wouldn't recognize it as being a TextBox.  I will ask around the team and see if we can find anyone who might understand. 

Thanks!
Samantha

Aug 11, 2009 at 11:31 PM
Hi Samantha,
Thanks for your response!
Here is my xaml. Is there anything that looks incorrect for changing the read only information to a text box?
I run the application and in the EmployeeName cell, there is Sam Jackson. I type in there Joe Smith and the cell is not seen as a text box control for some reason as I type Joe Smith.
Maybe I am not setting a property on the datagrid that needs to be set? Can you please confirm?
Sorry if the copy/paste looks terrible!
Does this xaml look ok and setup correctly for an edit operation?

<dg:DataGrid ItemsSource="{Binding ElementName=This, Path=EmployeeData}"

Margin="5" AutoGenerateColumns="False" CanUserAddRows="True" MinRowHeight="10" RowBackground="Cyan" RowDetailsVisibilityMode="VisibleWhenSelected" IsTabStop="True">

<dg:DataGrid.Columns>

<dg:DataGridTextColumn Binding="{Binding EmployeeName}" Header="Employee Name" />

<dg:DataGridTextColumn Binding="{Binding PhoneNumber}" Header="Telephone Number" />

<dg:DataGridComboBoxColumn Header="Job Title" x:Name="_JobTitleCombo"

SelectedItemBinding="{Binding JobTitle}" />

<dg:DataGridCheckBoxColumn Binding="{Binding IsFullTime}"

Header="Fulltime Employee" />

</dg:DataGrid.Columns>

</dg:DataGrid>

</Window>

Thanks!
Regards,
Justin

Aug 12, 2009 at 2:13 AM
Hi Samantha,
Does the wpf datagrid follow the UI Automation support for the table control type as outlined in this article?

Regards,
Justin

Aug 12, 2009 at 2:19 AM
Also, does the wpf datagrid use any concepts from the UI Automation table control pattern as outlined here:

Regards,
Justin

Coordinator
Aug 25, 2009 at 7:12 PM

Justin,

Datagrid is not a Table control type for UI Automation type, but it supports almost all properties, control patterns and events as the Table. Only that ControlTypeProperty returns "custom" for Datagrid instead of "Table".

For your second question, Datagrid implements ITableProvider pattern as well as IGridProvider and ISelectionProvider.

-Keerthi