custom databinding problem

  • Thread starter Thread starter astroboy
  • Start date Start date
A

astroboy

TextBoxEx1.DataBindings.Add("text", rst.DataTable, "FirstName")

I bind text property to datatable,

when I change the value of the text box from "Scott" to "Tom"

rst.DataTable.Rows(0).Item("FirstName") automatic change to "Tom" and that
good

the problem is rst.DataTable.Rows(0).RowState is unchanged. Should it be
"modified"??? any way it make automatic set to modified or anything other
than unchanged when the row did change.
 
Hi astroboy,

Try this after your change.

DirectCast(BindingContext(rst.DataTable, CurrencyManager).EndCurrentEdit()

(I would place it on another place when you use it really, by example just
before where you start your updates)

I hope this helps?

Cor
 
Not sure undertand your example what does your direct cast into?

And why using CurrentManager? It would be great if u can explain to me a bit
more clear

Thankx
 
Hi Astroboy,

I changed the CType because you can use the directcast also, that is a
little bit shorter than the CType and adviced when it is usable (and that is
almost forever). Ctype is something the same as a Cint and a Cdbl. A real
convert. But do not ask me that to deep. It is not direct in my interest.

The currency manager has nothing to do with money, but it keeps track of the
current selected row in a dataset.

I hope this helps?

Cor
 
Back
Top