rossmason

rossmason

  • NA
  • 15
  • 0

How do I default values into text boxes in a WINFORM using LINQ to SQL

Jun 25 2009 8:23 PM

I have a WINFORM that was built by dragging all of the files as textboxes from the data source pane. The data source was set up as LINQ data context. I tried using the bindingNavigatorAddNewItem_Click which get created for me when I clicked on the add button on the batchMasterBindingNavigator which came over with the textboxes.

 I tried using statements like:

updatedByTextBox.Text = "Test";

updatedDateTextBox.Text = DateTime.Today.ToShortDateString();

These textboxes populate when I press the add button, but  as soon as I tab through  another text box both  updatedByTextBox.Text and updatedDateTextBox.Text become blank.

What is the best practice to put default  values in text boxes bound to  a LINQ to SQL data context?

Thanks