I do have some default values set for this table. I have a sub
New(intSelectedID) that first calls me.New(). I was putting my databinding
in that sub, then setting the cm = me.bindingcontext . . in the Form load
event. When I put it all in the Load event, it works.
Don't know what that's about. The DataSet is a Shared member of my Data
"Ken Tucker [MVP]" <vb2ae@bellsouth.net> wrote in message
news:uBnjU5faEHA.1000@TK2MSFTNGP12.phx.gbl...
> Hi,
>
> Did you try setting the default values for the datacolumns?
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatadatacolumnclassdefaultvaluetopic.asp
>
>
> Ken
> --------------------
> "a" <a@a.com> wrote in message
news:eC5foTcaEHA.1764@TK2MSFTNGP10.phx.gbl...
> > Hey gang,
> >
> > I am near tears at this point. I have an app that runs in the UK and
the
> > US, and have already gone to school on DataTable.Compute and UK date
> > formats
> > (have to convert to EN-US). Also, the app has an 'online' (vb.net
> > webservice with typed datasets) and an 'offline' mode (xml files, same
> > datasets) and I went to school on the fact that some properties set in
the
> > dataset designer do not propogate to the WebReference (Like NullValue).
> >
> > I have one main data form. It has bound textboxes, combos, and a
> > usercontrol that formats the date '1/1/1900' to a blank and a blank to
> > '1/1/1900' since I could not serialize null dates. (arggh)
> >
> > The problem is this. I usually use a currency manager on my forms. To
> > add
> > a record I call cm.AddNew. To comit changes I call cm.EndCurrentEdit.
> > Here
> > is a sample of the initial binding:
> >
> > Me.dvForm.Table = TaskData.Data.dsTaskData1.tblTask
> >
> > Me.txtDescr.DataBindings.Add(New System.Windows.Forms.Binding("Text",
> > Me.dvForm, "Descr"))
> >
> > Me.cboType.DataSource = TaskData.Data.dsTaskData1
> >
> > Me.cboType.DisplayMember = "tblType.Name"
> >
> > Me.cboType.ValueMember = "tblType.ID"
> >
> > Me.cboType.DataBindings.Add(New
> > System.Windows.Forms.Binding("SelectedValue", Me.dvForm, "TypeRef"))
> >
> > . . . . .
> >
> > cm = Me.BindingContext(Me.dvForm)
> >
> >
> > I need to set some values when I call AddNew. Since they are
calculated,
> > I
> > don't want to update the autogenerated (WSDL) class, I want to calculate
> > them on the form itself. I have tried setting the TextBox.Text property
> > to
> > the value, and I have tried setting the CType(cm.current,
> > DataRowView)("TypeRef") and I have tried using AddNew on the DataView
> > (dvForm). Which is the right way to go, cm.AddNew or dvForm.AddNew? If
> > this works right, when I do an AddNew, will my comboboxes be blank, or
set
> > to the first value in the list? I prefer them to be blank because it
makes
> > more sense to the user.
> >
> > I used to have an issue where the cm would not go to the new row when,
for
> > instance, a checkbox was bound to a field and the field value was
> > DBNull.Value. I have been up for a long time, and I am getting
stupid-er,
> > and can't get things working. I have eliminated the bindings to be sure
> > none are breaking the move to the new row, but can't track it down.
> >
> > Final note: Some of the comboboxes are related to each other in a
> > heirarchical way. In dvForm, there are 4 levels of locations. In the
> > DataSet, there are 4 tables related to each other. My binding here seem
> > to
> > be working right.
> >
> > Thanks for ANY help!
> >
> > Kevin
> >
> >
> >
>
>