private void txtUnitCount_Changed(object Sender, TextChangedEventArgs e) { try { int index = 0; int rowIndex = -1; TextBox txt = Sender as TextBox; int Units = Convert.ToInt32(txt.Text); for (index = 1; index < dsBillingDetails.Tables.Count; index++) { DataRowCollection rowCol = dsBillingDetails.Tables[index].Rows; DataRow[] DataRows = dsBillingDetails.Tables[index].Select(find); if (DataRows.Count() > 0) { DataRow foundRow = DataRows[0]; rowIndex = rowCol.IndexOf(foundRow); if (rowIndex != -1) { //This line is causing problem i.e below line dsBillingDetails.Tables[index].AcceptChanges(); } break; } } } catch (Exception ex) { } }
jing111 wrote:…let me know how to add handler to a text box for lost focus event…
myElement.GotFocus += {sender, eventArgs} => { UIElement senderElement = (UIElement)sender; DoSomethingOnChangeOfTheFocusState(senderElement.IsFocused); // IsFocused will be true if got focus, false if lost };
UIElement.GotKeyboardFocus
UIElement.PreviewGotKeyboardFocus
UIElement
Focusable
myElement.Focus()
System.Windows.Forms
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)