Groups | Blog | Home
all groups > dotnet windows forms databinding > june 2004 >

dotnet windows forms databinding : DataBinding question


Alfred Gary Myers Jr.
6/24/2004 9:50:07 AM
Hi Mika!

Try this:

Dim binding As Binding = lblRecordID.DataBindings.Add("Text", dv, "ID")
AddHandler binding.Format, AddressOf FormatRecord

Sub FormatRecord(sender As Object e As ConvertEventArgs)
e.Value = "Record " & e.Value.ToString()
End Sub

HTH,

Alfred Gary Myers Jr.
www.yuma.com.br

[quoted text, click to view]

Mika M
6/24/2004 1:55:58 PM
Hi!

Is it possible to add automatically certain text bound context in object if
object is 'readonly' type like Labels?

I mean when I bound Label like ...

lblRecordID.DataBindings.Add("Text", dv, "ID")

.... it shows me number for example 5 - ok - but add automatically word
'Record' with this record number and get 'Record 5' into label control
automatically? I read datatable from XML-file. This DataView is only for
reading in my case.

--
Thanks in advance!

Mika

AddThis Social Bookmark Button