I have some controls on my form which are bound to a dataset and some which
are not bound.

But whatever record is displayed on the form, I want to populate those
control (datetime, combo, etc.) with the data in the current record.

What event can I do this in ?

PositionChanged of bindingContext - is this called before the record is
current or after ?

if it is after, I can use this.

Please advise.

HS

Re: Event on record change by Cor

Cor
Thu Feb 17 03:12:16 CST 2005

Hemang,

For the dateTime and Combo is probably the problem that you have to bind
those to the value.

Probably is that easier than doing it by hand.

I hope this helps?

Cor



Re: Event on record change by news

news
Thu Feb 17 03:34:22 CST 2005

Thanks Cor

But the reason I cannot bind to the dataset is because of the control's
limitation to handle DBNull values and also that multiple comboboxes with
the same datasource act in sync with one another which is unexpected.

:)


"Cor Ligthert" <notmyfirstname@planet.nl> wrote in message
news:uD55%23CNFFHA.3068@TK2MSFTNGP10.phx.gbl...
> Hemang,
>
> For the dateTime and Combo is probably the problem that you have to bind
> those to the value.
>
> Probably is that easier than doing it by hand.
>
> I hope this helps?
>
> Cor
>



Re: Event on record change by Cor

Cor
Thu Feb 17 06:12:36 CST 2005

News,

Your first question when it is for the datetimepicker (not tested with a
datetimepicker however I don't know why it would not

\\\
Private Sub myroutine()
Mybinding = New Binding("Value", ds.Tables(0), "mydatfield")
textdatfield.DataBindings.Add(Mybinding)
AddHandler mybinding.Format, AddressOf DBdateTextbox
AddHandler mybinding.Parse, AddressOf TextBoxDBdate
End sub
Private Sub DBdateTextbox(ByVal sender As Object, _
ByVal cevent As ConvertEventArgs)
If cevent.Value Is DBNull.Value Then
cevent.Value = ""
Else
Dim datum As Date
datum = CDate(cevent.Value)
cevent.Value = datum.ToString("d")
End If
End Sub
Private Sub TextBoxDBdate(ByVal sender As Object, _
ByVal cevent As ConvertEventArgs)
If cevent.Value.ToString = "" Then
cevent.Value = DBNull.Value
End If
End Sub
///

For the secondone you have to create for every control a different dataview
When you don't know how tell than what is your datasource at the moment.

I hope this helps?

Cor