Hi,
I am about 1month new to C# and WPF. Would appreciate some help with the following:
I have a DataGridTextColumn and DataGridTemplateColumn.
I have prepopulated the table row/column with some sample data.
When a user enters some text in the KEY column row, I would like to:
1. Determine the text that the user has entered - event drivien.
2. Based on (1), populate the row with additional data pertaining to the specific KEY row/column data.
I have the following in my DataGridTextColumn:
<DataGridTextColumn.EditingElementStyle>
<Style TargetType="{x:Type TextBox}">
<eventsetter event="TextInput" handler="TEXT_ENTERED" />
</Style>
In my C# code,
private void TEXT_ENTERED(object sender, RoutedEventArgs e)
{
TextBox t = (TextBox)sender;
string name = t.Text;
Debug.WriteLine(name);
}
The TEXT_ENTERED function does not work when the Event="TextInput". When I set the Event to "TextChanged", then I get an event for each character entered in the DataGridTextColumn.
I want to capture the whole text entered - either by entered in "ABC" followed by a carriage return, a mouse click elsewhere....etc.
Any help would be appreciated.
Another funny thing is that the above works for "TextInput" in Visual Studio 2010, but not in 2008.
Thanks,
Manish